Page 1 of 1

About Question enthuware.ocpjp.v7.2.1368 :

Posted: Fri May 30, 2014 2:01 pm
by ewebxml
Because the question states,
"Multiple threads need to access this information but none of them changes it."
This statement indicates that a Hashtable is not required.

Hashtable is synchronized, whereas HashMap is not.

In the scenario stated, synchronization is not required.

Please confirm.

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

Posted: Fri May 30, 2014 7:56 pm
by admin
That is correct. That is why the correct answer is option 2, HashMap.
HTH,
Paul.

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

Posted: Thu Jan 29, 2015 4:54 pm
by romsky
When the loading and the accessing the data happens in same time, then the answer is Hashtable.

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

Posted: Sun Dec 01, 2019 3:47 pm
by bioshark.dev
The question also states:
"Which class would be the most appropriate to store such data if the values need not be kept in a sorted fashion?"

Based on this "wrong" clue I have chosen my answer TreeMap, otherwise HashMap was the clear choice. You even mention this in the explanation:

"TreeMap is used to keep the keys sorted which makes it a little bit slower than HashMap. "

So the question and the explanation is a bit ambiguous and contradictory!

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

Posted: Sun Dec 01, 2019 5:33 pm
by admin
The statement says, "...need NOT be sorted...".

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

Posted: Tue Dec 03, 2019 7:58 am
by bioshark.dev
Must have been really tired to have missed that :)

P.S. I've taken and passed the exam yesterday. Big thanks to the entire team at EnthuWare. :cheers: