Question: sorting with anonymous inner classes, solve with explanation An online game tracks various pieces of data about its users, to allow it to present various

sorting with anonymous inner classes, solve with explanation
An online game tracks various pieces of data about its users, to allow it to present various statistics and league tables. You are going to create a Java class capable of storing this data in various properties, and a Java program that creates a number of instances of this class, and is able to sort ArrayLists of these objects to present the data. Table I, below, depicts the data held by the game on its players, with a brief description of what the data is normally used for. Table I: Player Data Held by Online Game Property Function Name Level Used to label the player's data with their name The player's level in game The player's best ever score High-Score Account Creation Date The date on which the account was created Total Play Time Total number of minutes spent in-game Used to track which players have played recently Last Login Date/Time You will need to create a Player Data class with properties for each of the pieces of data in Table I, selecting an appropriate data type for each of them. Your class will also need getters and setters for the properties, and a constructor method. You also need to create a Main class, complete with a main() method, which will create at least 10 players with appropriate data. Store these Player Data objects in an ArrayList. Write a program capable of sorting and displaying the data in each of the following formats. You will need to use the Collections.sort() method, an anonymous inner class that implements the Comparator interface, and the Collections.shuffle() method to complete the tasks. 1. Displayed in their original order (the order in which you created them) 2. Displayed in a random order 3. Sorted by their high score (highest first, like a high score table) 4. Sorted by their level (lowest first) 5. Sorted by last login date/time (most recent first)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
