• + 0 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 ; 
                    }
            });