Question: * JAVA PLEASE * Write a program that sorts an ArrayList in decreasing order so that the largest country is at the beginning of the
JAVA PLEASE
Write a program that sorts an ArrayList in decreasing order so that the largest country is at the beginning of the array.
Please include the following in your solution:
A class Country that includes name and area attributes of a country, provides accessors for the data attributes, and overloads toStringmethod to support string concatenation for consistent output.
Use Comparator in your country size comparison.
A main function that creates an ArrayList that includes the top largest countries in a random order please research the largest countries and their areas to create the ArrayList
Display the countries before and after sorting.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
