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
Q13: Which reserved word must be used to
Q18: The _ reserved word in a class
Q57: Which of the following is true regarding
Q60: A class that represents the most general
Q62: If a subclass contains a method with
Q67: Consider the following code snippet: Employee anEmployee
Q72: To test whether an object belongs to
Q94: Insert the missing code in the following
Q94: What must a subclass do to modify
Q99: Consider the following code snippet:<br>Public class Employee<br>{<br>)