Question: Example: We have an ArrayList of Student> called roll in a class called We have an ArrayList of called roll in a class called Gradebook.

Example: We have an ArrayList of Student> called roll in a class called We have an ArrayList of called roll in a class called Gradebook. Class Student consists of a String name, and a int grade, with a getter method for each.

GradeBook has a method listAll() that displays each entry [uses toString()] in the order it was added to the ArravList.

Assume that we will insert a statement: Collections.sort|roll) at the start of listA/l(), before we iterate through the list to display, and that we want to list students with highest grades first ["descending order by grade']

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!