
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between HashMap and LinkedHashMap in Java
In this post, we will understand the difference between HashMap and LinkedHashMap in Java.
HashMap
In this structure, the order of insertion is not preserved.
It uses the HashTable to store maps.
It extends the ‘AbstractMap’.
It implements the ‘Map’ interface.
This was introduced in JDK 2.0.
It has a relatively low overhead.
LinkedHashMap
In this structure, the order of insertion is not preserved.
It uses the HashTable and Linked List to store maps.
It extends the ‘Hashmap’.
It implements the ‘Map’ interface.
This was introduced in JDK 4.0.
It has a relatively higher overhead.
This is because it has to maintain the order of entries in the map structure.
Advertisements