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)
{
_________;
}
}
Complete the code in the Auto class constructor to store the type data.
A) super(type) ;
B) super(super(type) ) ;
C) super.super(type) ;
D) This cannot be done unless the Auto declares an instance variable named type.
Correct Answer:
Verified
Q22: Consider the following code snippet:
Public class Vehicle
{
)
Q23: Consider the following code snippet:
Public class Vessel
{
)
Q24: Consider the following class hierarchy:
Public class Vehicle
{
Private
Q25: Consider the following code snippet:
Public class Vessel
{
)
Q26: Consider the following code snippet that appears
Q28: If a subclass uses the same method
Q29: Consider the following code snippet:
Public class Vehicle
{
)
Q30: Consider the following code snippet:
Public class Employee
{
)
Q30: Which of the following statements about superclasses
Q32: Consider the following code snippet:
Public class Vehicle
{
)
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