Question: Consider the following code snippet: Vehicle aVehicle = new Auto ( ) ; aVehicle.moveForward ( 2 0 0 ) ; Assume that the class inherits
Consider the following code snippet:
Vehicle aVehicle new Auto;
aVehicle.moveForward;
Assume that the
class inherits from the
class, and both classes have an
implementation of the
method with the same set of parameters and the same
return type. What determines which class's
method is to be executed?
the actual object type.
the hierarchy of the classes.
the variable's type.
it is not possible to determine which method is executed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
