Pabl0o0

Untitled

Apr 4th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public interface Comparator2 {
  2. public static int compare2(Student st1, Student st2) throws ClassCastException {
  3. // TODO Auto-generated method stub
  4. if(!st1.getImie().equals(st2.getImie()))
  5. return st1.getImie().compareTo(st2.getImie());
  6. else if (!st1.getNazwisko().equals(st2.getNazwisko()))
  7. return st1.getNazwisko().compareTo(st2.getNazwisko());
  8. else
  9. return st1.getOcena().equals(st2.getOcena());
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment