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)
{
) . .
}
}
Public class Auto extends LandVehicle
{
Public Auto(String type)
{
) . .
}
Public String displayAutoType()
{
Return _____;
}
}
Complete the code in the Auto class method named displayAutoType to return the type data.
A) super(type) ;
B) super.type;
C) super.super.type;
D) This cannot be done unless the Auto class uses a public method in a superclass that returns the type data.
Correct Answer:
Verified
Q27: Which reserved word must be used to
Q35: Consider the following code snippet:
Public class Vehicle
{
)
Q36: If a subclass defines the same method
Q37: Consider the following code snippet:
Public class Vessel
{
Private
Q39: Consider the following code snippet:
Public class Employee
{
)
Q40: Consider the following code snippet:
Public void deposit(double
Q41: Consider the following class hierarchy:
Public class Vehicle
{
Private
Q42: Consider the following code snippet:
Public abstract class
Q43: Consider the following code snippet:
Public class Motorcycle
Q56: To override a superclass method in a
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