You are viewing a single comment's thread. Return to all comments →
Collections.sort(studentList,new Comparator<Student>(){ public int compare(Student s1,Student s2){ int[] res = {Double.compare(s2.getCgpa(), s1.getCgpa()),s1.getFname().compareTo(s2.getFname()), Integer.compare(s1.getId(), s2.getId())}; for (int r : res){if (r != 0){return r;}} return 0 ; } });
Seems like cookies are disabled on this browser, please enable them to open this website
Java Sort
You are viewing a single comment's thread. Return to all comments →