About Question enthuware.ocpjp.v8.2.1883 :
Posted: Wed Jun 14, 2017 3:51 am
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.
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.