Difference between HashMap and LinkedHashMap in java?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 28, 2014, 9:12 PM
The output is:
Notice that in the case of LinkedHashMap, the entries are iterated in the order they were added but this is not so in the case of HashMap.
Abhijeet SinghPosted Mar 28, 2014, 1:52 PM
Please Explain with example?
VulpesPosted Mar 24, 2014, 9:45 AM
In the case of the HashMap class, there is no guarantee that this will be the case - the order in which the elements are returned by an iteration will not necessarily be the same as the order in which they were added.