Multiple Choice
Consider the following code snippet: public class Vehicle
{
Private String manufacturer;
) . .
Public void setVehicleClass(double numberAxles)
{
) . .
}
}
If a Motorcycle class is created as a subclass of the Vehicle class, which of the following statements is correct?
A) A Motorcycle object inherits and can directly use both the instance variable manufacturer and the method setVehicleClass.
B) A Motorcycle object inherits and can directly use the instance variable manufacturer but not the method setVehicleClass.
C) A Motorcycle object inherits but cannot directly use either the instance variable manufacturer or the method setVehicleClass.
D) A Motorcycle object inherits and can directly use the method setVehicleClass but cannot directly use the instance variable manufacturer.
Correct Answer:

Verified
Correct Answer:
Verified
Q28: You are creating a class inheritance hierarchy
Q57: Which of the following is true regarding
Q68: Consider the classes shown below: public class
Q69: Consider the classes shown below: public class
Q71: You are creating a Motorcycle class which
Q72: Consider the following class hierarchy: public class
Q74: Consider the following code snippet: public class
Q75: Consider the following class hierarchy: public class
Q76: Consider the Counter class below. public class
Q77: With a few exceptions, instance variables of