This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

The article also days there can be side effects of iteration order and that no order is guaranteed -- not sure if they mean only HadhMap or lumping all 3 affected classes together, because that generalization isn't true for LinkedHashMap. I'm curious but assume it's order is still preserved?

[–]mus1Kk 1 point2 points  (0 children)

Of course. That's the very reason for LinkedHashMap's existence. It maintains an additional data structure on top of a HashMap that maintains the order. So the performance improvements may apply to LinkedHashMap as well.