subject

"class aggregate" is incorrect. choose the correct line so that this program prints:

granite: weight=25.0 value=4 numkind=7
public class inherit
{
abstract class stone
{
protected float weight = 13;
protected int value = 4;
abstract public string tostring( );
}
class aggregate
{
protected int numkind;
}
class granite extends aggregate
{
granite( )
{
weight = 25; numkind = 7;
}
public string tostring( )
{
return "granite: weight="
+ weight + " value="
+ value + " numkind="
+ numkind;
}
}
inherit( )
{
granite g = new granite( );
system. out. println(g);
}
public static void main(string[ ] args)
{
new inherit( );
}
}
a) abstract class aggregate {
b) abstract class aggregate extends granite {
c) abstract class aggregate extends stone {
d) class aggregate extends stone {
e) none of the above

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:31
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
You know the right answer?
"class aggregate" is incorrect. choose the correct line so that this program prints:

gr...
Questions