Last active
August 30, 2018 05:44
-
-
Save saqibmehmoodgit/7a6f8b5313c2950bb290cce628462728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public int compareTo(Student s) { | |
if (age == s.age) | |
{ | |
return 0; | |
} | |
else if (age > s.age) | |
{ | |
return 1; | |
} | |
else | |
{ | |
return -1; | |
} | |
} | |
/////////////////////// | |
else if (age < s.age) | |
{ | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment