Вы находитесь на странице: 1из 2

Create a class called Vehicle.

Java with instance variables make (such as Ford, GM, Toyota, or Honda),
year, and horsepower(such as 200, 300, and 400). Add the necessary constructor and set and get
methods. Then create classes Bus and Truck respectively. Bus has an instance variable called
numOfPassengers (such as 1 or 50) and Truck has an instance variable called towingCapacity (such as
0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own display methods
for displaying all their attributes (including the inherited ones).

Create a class called Vehicle.Java with instance variables make (such as Ford, GM, Toyota, or Honda),
year, and horsepower(such as 200, 300, and 400). Add the necessary constructor and set and get
methods. Then create classes Bus and Truck respectively. Bus has an instance variable called
numOfPassengers (such as 1 or 50) and Truck has an instance variable called towingCapacity (such as
0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own display methods
for displaying all their attributes (including the inherited ones).

Create a class called Vehicle.Java with instance variables make (such as Ford, GM, Toyota, or Honda),
year, and horsepower(such as 200, 300, and 400). Add the necessary constructor and set and get
methods. Then create classes Bus and Truck respectively. Bus has an instance variable called
numOfPassengers (such as 1 or 50) and Truck has an instance variable called towingCapacity (such as
0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own display methods
for displaying all their attributes (including the inherited ones).

Create a class called Vehicle.Java with instance variables make (such as Ford, GM, Toyota, or Honda),
year, and horsepower(such as 200, 300, and 400). Add the necessary constructor and set and get
methods. Then create classes Bus and Truck respectively. Bus has an instance variable called
numOfPassengers (such as 1 or 50) and Truck has an instance variable called towingCapacity (such as
0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own display methods
for displaying all their attributes (including the inherited ones).

Create a class called Vehicle.Java with instance variables make (such as Ford, GM, Toyota, or Honda),
year, and horsepower(such as 200, 300, and 400). Add the necessary constructor and set and get
methods. Then create classes Bus and Truck respectively. Bus has an instance variable called
numOfPassengers (such as 1 or 50) and Truck has an instance variable called towingCapacity (such as
0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own display methods
for displaying all their attributes (including the inherited ones).

Create a class called Vehicle.Java with instance variables make (such as Ford, GM, Toyota, or Honda),
year, and horsepower(such as 200, 300, and 400). Add the necessary constructor and set and get
methods. Then create classes Bus and Truck respectively. Bus has an instance variable called
numOfPassengers (such as 1 or 50) and Truck has an instance variable called towingCapacity (such as
0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own display methods
for displaying all their attributes (including the inherited ones).

Вам также может понравиться