Difference between HashMap and LinkedHashMap

LinkedHashMap is child class of HashMap and it is almost same as HashMap except the below differences.

HashMap LinkedHashMap
Underlying data structure of HashMap is HashTable. Underlying data structure of LinkedHashMap is HashTable + LinkedList
Insertion order is not preserved. Insertion order is preserved..
Introuduced in Java1.2. Introuduced in Java1.4.

Posted in collections and tagged , , .

3 Comments

  1. Youre so awesome, man! I cant believe I missed this blog for so long. Its just great stuff all round. Your design, man…too amazing! I cant wait to read what youve got next. I love everything that youre saying and want more, more, MORE! Keep this up, man! Its just too good.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">