You are viewing a single comment's thread. Return to all comments →
studentList.sort( Comparator.comparing( Student::getCgpa, (cgpa1, cgpa2) -> { return cgpa2.compareTo(cgpa1); }) .thenComparing(Student::getFname) .thenComparing(Student::getId) ); for(Student st: studentList){ System.out.println(st.getFname()); }
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 →