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()

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

1 Expert Approved Answer
Step: 1 Unlock

ChangeSpeed interface interface ChangeSpeed void speedUp void slowDown Vehicle abstract class im... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!