Pabl0o0

Untitled

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