UML Diagram of cars with abstract class Vehicle with public methods move(){abstract} and carryCargo() with child classes Truck and Car with Truck class having a private field weight:int and public methods Truck(int), Truck(), and move(), and Car class with protected file numberOfPeople:int and public methods Car(int), Car(), holdPeople(int):boolean, move() and then the Car class also implments and interface PeopleHauler that has public methods holdPeople(int):boolean and move(), also OilTanker is a child class of Truck with private field capacity:int and public methods OilTanker(int,int), OilTanker(int), and move()
Using the information in the UML diagram above, suppose we execute the following Java statements:

Vehicle vehicle = new OilTanker(2500);
vehicle.move();

which definition of move will be executed?

The one defined in OilTanker
  • The one defined in Truck
  • The one defined in Vehicle
  • The one defined in PeopleHauler

PeopleHauler is an interface, it does not contain an implementation of move