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 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
The length of time that a slide appears before automatically advancing to the next slide can be set in the timing group under the transitions tab. transition to this slide group under the transitions tab. timing group in the master slide view. transition to this slide group in the master slide view.
Answers: 1
You know the right answer?
Questions 2 – 4 refer to the following classes:
public class Thing {
private int value;<...
Questions
question
Mathematics, 01.07.2020 23:01
question
Social Studies, 01.07.2020 23:01
question
Mathematics, 01.07.2020 23:01
Questions on the website: 13722360