Solved

Consider the Classes Shown Below: Public Class Parent

Question 68

Multiple Choice

Consider the classes shown below: public class Parent
{
Private int value = 100;
Public int getValue()
{
Return value;
}
}
Public class Child extends Parent
{
Private int value;
Public Child(int number)
{
Value = number;
}
}
What is the output of the following lines of code?
Child kid = new Child(-14) ;
Child kid2 = new Child(21) ;
System.out.println(kid.getValue() + " "
+ kid2.getValue() ) ;


A) -14 21
B) 21 21
C) 21 100
D) 100 100

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions