Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int compareTo(Student to) {
- if (this.getCgpa() != to.getCgpa()) {
- return (new Double(to.getCgpa())).compareTo(this.getCgpa());
- }
- if (this.getFname() != to.getFname()) {
- return this.getFname().compareTo(to.getFname());
- }
- return (new Integer(this.getId())).compareTo(to.getId());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement