Question: write the following programs: Ram.java, Truck.java, LandVehicle.java and Vehicle.java. public class Ram extends Truck { public static void main(String[] args) { // your implementation }
write the following programs: Ram.java, Truck.java, LandVehicle.java and Vehicle.java.
-
public class Ram extends Truck { public static void main(String[] args) {// your implementation }
public Ram() { // your implementation} }
public class Truck extends LandVehicle { public Truck() {// your implementation }
public Truck(String s) { // your implementation} }
public class LandVehicle extends Vehicle { public LandVehicle() {// your implementation }
}
public class Vehicle { public Vehicle() {// your implementation
Requirements:
-
Your Java class names must follow the names specified above. Note that they are case sensitive. See our template below.
-
Class Ram contains a main method, which is the entrance of the program.
-
Each class has to have its no-arg constructor. The behavior of the constructor is
to print out a String. For example, class Truck's constructor will print "Truck's
no-arg constructor is invoked.".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
