Create Java Book objects using the following data and place them in a List. (Fields: Author, Title, Year, Price) Java Programming,Deitel,2016,68.75 Python Programming,Gaddis,2018,78.56 Data Analytics,Norman,2017,89.56 Block Chain Development,Wilson,2019,87.45 Web Development,Brown,2018,98.98 Create TWO List Comparators to sort the Book objects in ascending order: One by Book Title and the second by Book Year. Using each Comparator, SORT the List once by Title and again by Year. NOTE: You MUST use the Comparator to SORT. Cannot use any other built in sort methods. Output each SORTED List on Console in a format same as the data shown above (One Book per line, comma separated).
Create Java Book objects using the following data and place them in a List.
(Fields: Author, Title, Year, Price)
Java
Python Programming,Gaddis,2018,78.56
Data Analytics,Norman,2017,89.56
Block Chain Development,Wilson,2019,87.45
Web Development,Brown,2018,98.98
Create TWO List Comparators to sort the Book objects in ascending order: One by Book Title and the second by Book Year.
Using each Comparator, SORT the List once by Title and again by Year.
NOTE: You MUST use the Comparator to SORT. Cannot use any other built in sort methods.
Output each SORTED List on Console in a format same as the data shown above (One Book per line, comma separated).
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images