12.7k views
1 vote
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 ____.

1 Answer

4 votes

Answer:

Dynamic method lookup.

Step-by-step explanation:

In the above question. some details of the questions are missing that is code.

Vehicle aVehicle = new Auto();

aVehicle.moveForward(200);

In the following scenario, the following class inherits the Vehicle class then, among the classes have the following method that implemented to the same set of the following parameters and returns that same type. So the procedure towards deciding that class to perform the following method is called the dynamic method search.

User Mark Nichols
by
4.5k points