Question: Create a class called Book that stores information such as the title, writer's list, and year published. Implement the necessary constructors as well as
Create a class called Book that stores information such as the title, writer's list, and year published. Implement the necessary constructors as well as the getters and setters for the class Book. In addition, implement the equals (..) method in order to compare 2 Books. This method should return true if both books have the same writers and return false otherwise. The book class should also implement the Comparable interface. The compare To (..) method should be used to compare the books by their publication years. Finally, create the main (..) method to test all functions in code. To test the comparison method, create a static array of books and use Arrays.Sort(..) method. The output should display the array before sorting and after sorting.
Step by Step Solution
3.30 Rating (147 Votes )
There are 3 Steps involved in it
Java import javautilArrays import javautilComparator class Book impl... View full answer
Get step-by-step solutions from verified subject matter experts
