Question: Create an interface called ChangeSpeed. Give it a method public void speedUp() and public void slowDown() Create an abstract class called Vehicle and implement

Create an interface called ChangeSpeed. Give it a method public void speedUp() and public void slowDown() Create an abstract class called Vehicle and implement the interface ChangeSpeed Create a Train, Car and Bicycle class that extend the Vehicle class, resolve any compilation problems In your main() method create an array of Vehicles. Make about 5 vehicles that are a mix of Train, Car and Bicycle. Then iterate through the array with a for loop and call the speedUp() and slowDown() methods on each Vehicle. Look at the solutions ChangeSpeed.java, Vehicle,java, Train.java, Car.java, Bicycle.java and VehicleMain.java.
Step by Step Solution
3.46 Rating (162 Votes )
There are 3 Steps involved in it
ChangeSpeed interface interface ChangeSpeed void speedUp void slowDown Vehicle abstract class im... View full answer
Get step-by-step solutions from verified subject matter experts
