I got confused, as the answer suggested option A.
Shouldn't aVehicle bound be viewed as a Vehicle object since the first line operated upcasting?
The question as follow:
Consider the following code snippet:
Vehicle aVehicle = new Auto();
aVehicle.moveForward(200);
If the Auto class inherits from the Vehicle class, and both classes have an implementation of the
moveForward method, which statement is correct?
A) The moveForward method of the Auto class will be executed.
B) The moveForward method of the Vehicle class will be executed.
C) You must specify in the code which class's moveForward method is to be used.
D) It is not possible to determine which class it's method is called.