A method in Java which allows a collection of vehicle objects to dynamically invoke drive() in plane and boat is: d. public void drive() {...}.
<h3>What is an object class?</h3>
In object-oriented programming (OOP) language, an object class represents the superclass of every other classes when using a programming language such as Java. Also, the superclass is more or less like a general class in an inheritance hierarchy.
This ultimately implies that, a subclass can inherit the variables or methods of the superclass.
In this scenario, a method in Java which allows a collection of vehicle objects to dynamically invoke drive() in plane and boat is: d. public void drive() {...}.
Read more on object class here: brainly.com/question/14963997
#SPJ4
Complete Question:
Which XXX allows a collection of Vehicle objects to dynamically invoke drive() in Car and Boat ?
public class Vehicle {
XXX
}
public class Plane extends Vehicle {
Override
public void drive() {...}
}
public class Boat extends Vehicle {
Override
public void drive(){...}
}
a. public void super.drive() {...}
b. public void drive(int miles) {...}
c.private void drive() {...}
d. public void drive() {...}