About Question enthuware.ocpjp.v7.2.1119 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
horst1a
Posts: 37
Joined: Mon Jun 12, 2017 2:16 am
Contact:

About Question enthuware.ocpjp.v7.2.1119 :

Post by horst1a »

I cannot see why its sorting the zips and not the street, as the output is

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests