Question: This is a java project. Details Consider you are designing vehicles engine. When you are done with the hardware part, you want some of the

This is a java project.

Details

  • Consider you are designing vehicles engine.
  • When you are done with the hardware part, you want some of the software functionalities to be implemented by a client who is using your engine. So, in that case, you can define your engine functionalities in an interface.
  • Your interface is named Engine and its able to change gear and speed.

void changeGear(int a);

void speedUp(int a);

  • Create a class Vehicle implementing the above interface and implements its methods.
  • In the main, create vehicle object and set the gear to 3 and speed to 70 and then call this line:

System.out.println(objv);

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!