144k views
4 votes
A subclass of Value, LargerValue, is defined with a getValue method that returns twice the value of the parent. Which line is the body of LargerValue's getValue method?

1 Answer

7 votes

Answer:

return super.getValue() * 2;

suppose the class Value is partially defined below

public class Value

{

private int number;

public int getValue()

{

return number;

}

}

Step-by-step explanation:

see Answer

User Tsounabe
by
3.1k points