Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface Comparator2 {
- public static int compare2(Student st1, Student st2) throws ClassCastException {
- // TODO Auto-generated method stub
- if(!st1.getImie().equals(st2.getImie()))
- return st1.getImie().compareTo(st2.getImie());
- else if (!st1.getNazwisko().equals(st2.getNazwisko()))
- return st1.getNazwisko().compareTo(st2.getNazwisko());
- else
- return st1.getOcena().equals(st2.getOcena());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment