Solved

Consider the Following Code Snippet

Question 29

Multiple Choice

Consider the following code snippet:
Public class Vehicle
{
) . .
Public void setVehicleClass(double numberAxles)
{
) . .
}
}
Public class Motorcycle extends Vehicle
{
) . .
Public void setVehicleClass(double numberAxles)
{
) . .
}
}
Which of the following statements is correct?


A) The Motorcycle class overrides the setVehicleClass method.
B) The Vehicle class overrides the setVehicleClass method.
C) The Motorcycle class overloads the setVehicleClass method.
D) The Vehicle class overloads the setVehicleClass method.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions