Collections.sort(orderedStudents, new Comparator<Student>() {
public int compare(Student s1, Student s2) {
return s2.getAggregate().compareTo(s1.getAggregate());
}
});
This is the method i used.
The problem is the getAggregate
method:
public Double getAggregate(){
double d = 0;
double aggregatescore = d/marks.size();
return aggregatescore;
}
Since d is set to be zero, this method will return always 0, so the Collections.sort(...)
method will do nothing