Question: JAVA. Please, help ASAP Create a data class named Automobile that implements the Comparable interface. Give the class data fields for make, model, year, and

JAVA. Please, help ASAP

JAVA. Please, help ASAP Create a data class named Automobile that implements

Create a data class named Automobile that implements the Comparable interface. Give the class data fields for make, model, year, and price. Then add a constructor, all getters, a toString method that shows all attribute values, and implement Comparable by using the price as the criterion for comparing instances Write a program named TestAutos that creates an ArrayList of five or six Automobiles. Use a for loop to display the elements in the ArrayList. Sort the Arraylist of autos by price with Collections.sort). Finally, use a foreach loop to display the ArrayList sorted by price. Create an application that consists of these four files: class Animal having: the protected field name of type String . a constructor that can set the value of the name field . an abstract method named walksHow that retuns a String interface Bird having: an abstract method named canFly) that returns a boolean . class Cassowary that extends Animal and implements Bird: has a private String field named habitat implements the abstract methods walksHow) and canFly). See output of AnimalTest. has a constructor that can set the values of the name and habitat elds has a toString0 method that shows the values of a Cassowary instance's fields executable class AnimalTest with . a main method that instantiates a Cassowary named Cassie . displays Cassie's field values . indicates if Cassie can fly and how Cassie walks Cassowary name: Cassie, habitat: Australia Can Cassie fly? false Cassie strides step by step

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!