2. In data structures and algorithms, sorting is a very important operation. There are two ways to allow a class to be sorted:
- There is a source code of a class, sort a member variable, let the class implement the Comparable interface, and call Collection.sort(List)
- If there is no source code of the class, or multiple sorting, create a new class, implement the Comparator interface and call Collection.sort(List, Compatator)
For the following Student class, use Comparator programming to complete the following functions:
- Create a new student list in the test class StudentTest, including two students before and after oneself and student number, a total of 5 students, and give the running results (before sorting, after sorting)
- Sort these 5 students in increasing order by student number and total score, and submit the codes of two Comparators
- Submit code to Code Cloud after class