A car company wants to keep a list of all the cars that they have in stock. The company…
Jump to turn (6)
- 1A car company wants to keep a list of all the cars that they have in stock. The
- 2it failed the garage initialized correctly? test
- 3this is what they wanted? ArrayList garage = new ArrayList ();
- 4A teacher wants to create a list of students in her class. Using the existing St
- 5Now that the classList Array has been implemented, we need to create methods to
- 6Create a method removeEvens that removes all even elements from an ArrayList of
- User
A car company wants to keep a list of all the cars that they have in stock. The company has created a ClassicCar class that stores important information about each of their cars.
Initialize an ArrayList called garage that stores each ClassicCar that the company has in stock.public class ClassicCar { String name; String model; int cost;
codepublic ClassicCar(String name, String model, int cost) { this.name = name; this.model = model; this.cost = cost; }} import java.util.ArrayList; public class CarTracker { public static void main(String[] args) { //Initialize your ArrayList here: ArrayList garage = new ArrayList<>(); } }
- Assistant