//------------------------------------------------------------------------ // class Motorcycle – inheritance //------------------------------------------------------------------------ public class Motorcycle extends MotorVehicle { protected int numberWheels = 2; public Motorcycle() { } // constructors public Motorcycle(String licensePlate, double maxSpeed, String make, String model, int year, int numberOfPassengers) { this(licensePlate, 0.0, maxSpeed, make, model, year, numberOfPassengers); } // public Motorcycle(String licensePlate, double speed, double maxSpeed, // String make, String model, int year, int numberOfPassengers) { // this(licensePlate, speed, maxSpeed, make, model, year, // numberOfPassengers); // } public Motorcycle(String licensePlate, double speed, double maxSpeed, String make, String model, int year, int numberOfPassengers) { // invoke superclass constructor super(licensePlate, speed, maxSpeed, make, model, year, numberOfPassengers); } public int getNumberOfWheels() { return this.numberWheels; } }