HashMap:
- Order not maintains
- Faster than LinkedHashMap
- Used for store heap of objects
LinkedHashMap:
- LinkedHashMap insertion order will be maintained
- Slower than HashMap and faster than TreeMap
- If you want to maintain an insertion order use this.
TreeMap:
- TreeMap is a tree-based mapping
- TreeMap will follow the natural ordering of key
- Slower than HashMap and LinkedHashMap
- Use TreeMap when you need to maintain natural(default) ordering
↧
Answer by Premraj for Difference between HashMap, LinkedHashMap and TreeMap
↧