subject
Computers and Technology, 20.03.2020 18:11 jahzz

Questions 2 – 4 refer to the following classes:
public class Thing {
private int value;

public Thing() {
value = (int)(Math. random () * 100);
}

public String toString() {
return "" + value;
}

// other methods not shown
}
public class Cog extends Thing {
private int num;

public Cog () {
num = (int)(Math. random () * 100);
}

public String toString() {
return "" + num;
}
}

Consider the following declaration:
public class Gear extends Cog
Which of the following is true?

Gear cannot extend Cog since classes can only inherit from one class.
Gear can access all variables in both Cog and Thing.
Gear cannot access any methods in Thing.
Gear's constructor calls the constructor in Cog and Thing.
Gear's constructor calls the constructor in Cog, which calls the constructor in Thing.

Which of the following is NOT true?

Cog cannot directly access the variable value in Thing.
Cog can call the constructor in Thing directly using the super keyword.
The constructor in Cog automatically calls the constructor in Thing.
Cog can call the toString method in Thing.
Thing can call the toString method in Cog.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
What is the main benefit of minimizing the ribbon in word? more options will be accessible through customized keystrokes. more of the document will be viewable without needing to scroll. fewer controls will be accessible to the user by using the mouse. fewer editing options will be available without entering a password.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Which of these is a benefit of using objects in a powerpoint presentation? a. collaborators can create the external files while you create and edit the slide show. b. you can easily change the theme and design of the presentation. c. you can have older data in the source file while having up-to-date data in the presentation. d. collaborators can easily share the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Hey so i was just trying out some game hacks so i took a paste from online and built it in my visual studio and then suddenly my computer was working or clicking on stuff on its own am i hacked?
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
You know the right answer?
Questions 2 – 4 refer to the following classes:
public class Thing {
private int value;<...
Questions
question
Mathematics, 26.05.2021 18:50
question
History, 26.05.2021 18:50
question
Biology, 26.05.2021 18:50
Questions on the website: 13722363