Using a main method within PersonTester: 1. Instantiate an ArrayList but referen
ID: 645512 • Letter: U
Question
Using a main method within PersonTester: 1. Instantiate an ArrayList but reference it using List 2. Add three Person objects to the ArrayList you created in task 1 3. Use a loop to print the three person objects on screen, before sorting 4. Use Collections.sort() with the List and the Comparator provided to sort the Person objects by FirstName 5. Use a loop to print the three person objects on screen, after sorting Bonus: Define 2 Comparators one to sort by Person last name, a second for age. Then demonstrate using them.Explanation / Answer
Hope this may helps you..
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.