Solved

Consider the Following Code Snippet: Vehicle AVehicle = New Auto();

Question 54

Multiple Choice

Consider the following code snippet: Vehicle aVehicle = new Auto() ;
AVehicle.moveForward(200) ;
Assume that the Auto class inherits from the Vehicle class, and both classes have an implementation of the moveForward method with the same set of parameters and the same return type. Which class's moveForward method is to be executed is determined by ____.


A) the actual object type.
B) the variable's type.
C) the hierarchy of the classes.
D) it is not possible to determine which method is executed.

Correct Answer:

verifed

Verified

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

Related Questions