Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**java program** Create an Interface Vehicle with method changeGear(int a), speedUp(int a) and applyBrakes(int a). Create two classes bicycle and bike which will implement Vehicle
**java program**
Create an Interface Vehicle with method changeGear(int a), speedUp(int a) and applyBrakes(int a). Create two classes bicycle and bike which will implement Vehicle interface. Both classes contain two attributes speed and gear. Where changegear method set the value of gear and speedup for increasing the speed and applyBrakes for decreasing the speed. In the main method create one instance of bicycle and one instance of bike class. Perform three operation on this two objects and display the information.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started