Question: ArrayList autoList = new ArrayList Auto > ; Car newCar = new Car ( Corvette , 8 . 0 , Red, 2 )
ArrayList autoList new ArrayList Auto ;
Car newCar new Car Corvette "Red", ; Truck newTruck new TruckToyota "Silver", ;
autoList.addnewCar;
autoList.addnewTruck;
for Auto a : autoList
a printStats;
When you run the test application, the output should be as follows:
Car Brand: Corvette MPG: Color:Red Number of Doors:
Truck Brand: Toyota MPG: Color:Silver HP:
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
