Question: Class Car Properties: make:String, model:String, price:double Methods: Parameterized constructor for initializing a new Car instances properties Getters for each property toString method to display a
Class Car
Properties:
make:String, model:String, price:double
Methods:
Parameterized constructor for initializing a new Car instances properties
Getters for each property
toString method to display a Cars properties
Class CarComparator
Code it to compare Car objects by price from lowest to highest
Class CarLists (main class) code it in this order
Create an ArrayList of at least six cars, not ordered in any way by price.
Create an Iterator and use it to display the entire list of cars.
Display the most expensive car in the list. Use the Collections class.
Create a linked list from the arraylist.
Insert another Car at index 4 in the linked list. This car should now be the cheapest in the list.
Sort the linked list in order of increasing price.
Remove the first and last Cars from the linked list, displaying them as you do so.
Create and use a ListIterator to display the linked list in order of increasing price.
Use the ListIterator again to iterate back through the list so cars are now shown in order of decreasing price.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
