Question: Consider the following interface Vehicle. interface Vehicle { void changeGear(char newGear); void increaseSpeed(int newSpeed); void decreaseSpeed(int newSpeed); } Create the classes Car and Bus that

Consider the following interface Vehicle.

interface Vehicle

{

void changeGear(char newGear);

void increaseSpeed(int newSpeed);

void decreaseSpeed(int newSpeed);

}

Create the classes Car and Bus that implements the methods of interface Vehicle.

Add gear and speed fields in Car and Bus classes.

changeGear() method sets the gear field by newGear value.

increaseSpeed() method increases the speed field by newSpeed value.

decreaseSpeed() method decreases the speed field by newSpeed value.

I want the solution to be in java bluej

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!