Multiple Choice
Consider the following class hierarchy: public class Vehicle
{
Private String type;
Public Vehicle(String type)
{
This.type = type;
}
Public String displayInfo()
{
Return type;
}
}
Public class LandVehicle extends Vehicle
{
Public LandVehicle(String type)
{
Super(type) ;
}
}
Public class Auto extends LandVehicle
{
Public Auto(String type)
{
Super(type) ;
}
}
You have written a program to use these classes, as shown in the following code snippet:
Public class VehicleTester
{
Public static void main(String[] args)
{
Auto myAuto = new Auto("sedan") ;
System.out.println("MyAuto type = " + ______) ;
}
}
Complete the code in this program snippet to correctly display the auto's type.
A) myAuto.displayInfo()
B) myAuto.super.displayInfo()
C) myAuto.super.super.displayInfo()
D) This cannot be done unless the Auto class overrides the displayInfo method.
Correct Answer:

Verified
Correct Answer:
Verified
Q2: Which of the following indicates that a
Q3: Consider the following code snippet: public class
Q5: Consider the following code snippet: public class
Q6: Which of the following indicates that the
Q7: Consider the following code snippet: public class
Q8: Consider the classes shown below: public class
Q9: Suppose the class Message is partially defined
Q10: Consider the following code snippet: Vehicle aVehicle
Q11: Consider the following code snippet: public class
Q73: Which of the following is true regarding