After reading the documentation for LinkedHashMap
(and having used it several times), I'm still not clear about one of its properties. Is the iteration order for a LinkedHashMap
:
entrySet()
, keySet()
, and values()
, orentrySet()
and keySet()
but not values()
, orentrySet()
?I imagine the third scenario to be unlikely, but I would like to know if anyone knows if (1) or (2) is true since iteration over values()
is probably a rare use case.
LinkedHashMap
respects insertion order; so the first choice is the good.
A Map
being a set of Map.Entry
objects, options 2 and 3 would be rather strange ;)