Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public int compareTo(Student to) {
  2.         if (this.getCgpa() != to.getCgpa()) {
  3.             return (new Double(to.getCgpa())).compareTo(this.getCgpa());
  4.         }
  5.         if (this.getFname() != to.getFname()) {
  6.             return this.getFname().compareTo(to.getFname());
  7.         }
  8.         return (new Integer(this.getId())).compareTo(to.getId());
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement