Create an Airplane class (not abstract) that
uses the Vehicle interface in Q1. The code for all methods should
print simple messages to the screen using System.out.println(). Add
an integer speed variable that is changed using
the ChangeSpeed method. ChangeSpeed adds 5 to the
speed each time it is called. Create a default
constructor that sets the initial speed to 0. Don't create
other constructors or any setter/getter methods.
PLEASE CODE THIS IN JAVA
//Airplane.java public class Airplane implements Vehicle{ int speed; public Airplane() { this.speed = 0; } public void Start() { System.out.println("Start method called"); } public void Stop() { System.out.println("Stop method called"); } public void ChangeSpeed() { speed += 5; } public int getSpeed() { return speed; } public void setSpeed(int speed) { this.speed = speed; } }
Get Answers For Free
Most questions answered within 1 hours.