About Question enthuware.ocpjp.v8.2.1883 :

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

Moderator: admin

Post Reply
UncleF
Posts: 11
Joined: Wed Jun 14, 2017 3:43 am
Contact:

About Question enthuware.ocpjp.v8.2.1883 :

Post by UncleF »

Hi,

the correct answer to this question is [1, 1, 3],
but how am I supposed to know that numbers will be printed in this particular order?
I mean groupingBy is using HashMap as default Map type and it doesn't guarantee ordering of keys.
Maybe this question needs to be rephrased or TreeMap constructor have to be provided to make it clear.

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

Re: About Question enthuware.ocpjp.v8.2.1883 :

Post by admin »

You are right about order cannot be known. However, notice that there is no option with same elements but different order. There is no option that says "None of the above". Thus, the order is not really important for this question.

Since you know there is exactly one correct option, you should select this option without worrying about the order. This is how you should do in the real exam as well.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 117 guests