About Question enthuware.ocpjp.v7.2.1119 :
Moderator: admin
-
- Posts: 37
- Joined: Mon Jun 12, 2017 2:16 am
- Contact:
About Question enthuware.ocpjp.v7.2.1119 :
I cannot see why its sorting the zips and not the street, as the output is
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1119 :
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.
Who is online
Users browsing this forum: No registered users and 30 guests