Course Solutions Uncategorized (Solved) : Need Help Application Composed 4 Classes Vehicle Car Motorcycle Truck Following Code Descr Q33249075 . . . .

(Solved) : Need Help Application Composed 4 Classes Vehicle Car Motorcycle Truck Following Code Descr Q33249075 . . . .

 

i need some help!

An application is composed of 4 classes:Vehicle, Car,Motorcycle, and Truck. Thefollowing code describes the relationships between theseclasses.

class Vehicle {

   int wheels = 4;

   public void engineStart() {

       System.out.println(“Enginestarted. . .”);   }

   public void drive() {

       System.out.println(“Driving onthe pavement on ” + wheels + ” wheels”);   }

}

class Car extends Vehicle {

   public Car() {

       System.out.println(“I’m acar:”);   }

   public void doorLock() {

       System.out.println(“Locking alldoors.”);   }

}

class Motorcycle extends Vehicle {

   // Hides the data of the parent class.

   int wheels = 2;

   public Motorcycle() {

       System.out.println(“I’m amotorcycle:”);   }

   public void riding() {System.out.println(“Riding on” + wheels

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post