Consider the classes shown below: public class Parent
{
Public int getValue()
{
Return 24;
}
Public void display()
{
System.out.print(getValue() + " ") ;
}
}
Public class Child extends Parent
{
Public int getValue()
{
Return -7;
}
}
Using the classes above, what is the output of the following lines of code?
Child kid = new Child() ;
Parent adult = new Parent() ;
Kid) display() ;
Adult.display() ;
A) 24 24
B) -7 -7
C) -7 24
D) 24 -7
Correct Answer:
Verified
Q68: Suppose the abstract class Message is defined
Q69: Consider the following code snippet: Vehicle aVehicle
Q71: A class from which you cannot create
Q72: Consider the following code snippet: Employee anEmployee
Q74: Consider the Counter class below. public class
Q76: Consider the Counter class below. public class
Q77: Consider the following code snippet: Vehicle aVehicle
Q78: Consider the following code snippet: public abstract
Q79: Which of the following statements about classes
Q80: Which of the following statements about classes
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents