Question: Instructions Using your Vehicle.java, Car.java and Truck.java classes from Chapter 2 assignment create a new main method. In the main method, create an ArrayList of

Instructions Using your Vehicle.java, Car.java and Truck.java classes from Chapter 2 assignment create a new main method. In the main method, create an ArrayList of Vehicle objects. Prompt the user for the attributes of 2 Car objects and 2 Truck objects that you will create and add to the ArrayList. After the ArrayList is complete, use a for loop or enhanced for-loop to print the toString() method of each object in the ArrayList individually. Do not simply print the ArrayList. Instructions Using your Vehicle.java, Car.java and Truck.java classes from Chapter 2 assignment create a new main method. In the main method, create an ArrayList of Vehicle objects. Prompt the user for the attributes of 2 Car objects and 2 Truck objects that you will create and add to the ArrayList. After the ArrayList is complete, use a for loop or enhanced for-loop to print the toString() method of each object in the ArrayList individually. Do not simply print the ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
