About Question enthuware.ocpjp.v7.2.1725 :
Posted: Thu Dec 31, 2015 2:15 am
Hie Paul,
I understand that option two on this question is correct since the compare can use the compareTo method to return a result, however i cannot explain what is wrong with option three:
Collections.sort(al, new Comparable<Person>(){ public int compare(Person o1, Person o2) { return o1.dob.compare(o2.dob); } });
May u please explain to me why option three is not correct
I understand that option two on this question is correct since the compare can use the compareTo method to return a result, however i cannot explain what is wrong with option three:
Collections.sort(al, new Comparable<Person>(){ public int compare(Person o1, Person o2) { return o1.dob.compare(o2.dob); } });
May u please explain to me why option three is not correct