
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
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.
- Related Articles
- Difference between TreeMap, HashMap, and LinkedHashMap in Java
- Difference between TreeMap, HashMap and LinkedHashMap in Java programming
- Differences between TreeMap, HashMap and LinkedHashMap in Java
- What is the differences between TreeMap, HashMap and LinkedHashMap in Java?
- Difference between HashMap and HashTable in Java.
- Difference between HashMap and ConcurrentHashMap in Java
- Difference between HashTable and HashMap in Java
- Difference between HashMap and HashSet in Java.
- Difference between EnumMap and HashMap in Java
- Difference Between HashMap and TreeMap in Java
- How to implement HashMap, LinkedHashMap, and TreeMap in JShell in Java 9?
- Difference between Concurrent hash map and Synchronized hashmap in Java
- Difference between HashMap and ConcurrentHashMap
- Difference between Map and HashMap
- Differences between HashMap and Hashtable in Java

Advertisements