1public class AgeComparatorDesc implements Comparator<Student> {
2
3 @Override
4 public int compare(Student o1, Student o2) {
5 if (o1.age > o2.age) {
6 return -1;
7 } else if (o1.age < o2.age) {
8 return 1;
9 }
10 return 0;
11 }
12
13}