Page 1 of 1

About Question enthuware.ocpjp.v7.2.1119 :

Posted: Thu Sep 28, 2017 10:29 am
by horst1a
I cannot see why its sorting the zips and not the street, as the output is

Re: About Question enthuware.ocpjp.v7.2.1119 :

Posted: Thu Sep 28, 2017 10:49 pm
by admin
Because Address class implements Comparable and its compareTo method is implemented to sort on zips first, and if the zips for two objects are same, sort on street names.