Question: Add a new class that extends Vehicle. This new class can be anything you want. Add A Tank Write your class to have Crush as
Add a new class that extends Vehicle. This new class can be anything you want. Add A Tank
Write your class to have Crush as one attribute and method
Create an instance of your new class in Main and call one of its methods, as well as the honk method that it inherits.
Using this java code
class Main
public static void mainString args
Create a myCar object
Car myCar new Car;
Call the honk method from the Vehicle class on the myCar object
myCar.honk;
myCar.drive;
myCar.drive;
myCar.drive;
Display the value of the brand attribute from the Vehicle class and the value of the modelName from the Car class
System.out.printlnmyCar;
Jetski watercraft new Jetski;
watercraft.goOnWater;
watercraft.honk;
These are a no no:
myCargoOnWater;
watercraftdrive;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
