Examlex

Solved

Consider the Classes Shown Below: Public Class Parent

question 51

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) ;
Parent adult = new Parent() ;
System.out.println(kid.getValue() + " "
+ adult.getValue() ) ;


Definitions:

Related Questions