Consider the following code snippet: public class Vehicle { . . . public void se
ID: 3642812 • Letter: C
Question
Consider the following code snippet:public class Vehicle
{
. . .
public void setVehicleClass(double numberAxles)
{
. . .
}
}
public class Auto extends Vehicle
{
. . .
public void setVehicleClass(int numberAxles)
{
. . .
}
}
Which of the following statements is correct?
Answer
a.
The
Auto
class overrides the
setVehicleClass
method.
b.
The
Vehicle
class overrides the
setVehicleClass
method.
c.
The
Auto
class overloads the
setVehicleClass
method.
d.
The
Vehicle
class overloads the
setVehicleClass
method.
Explanation / Answer
d. The Vehicle class overloads the setVehicleClass method.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.