- A LinkedHashMap contains values based on the key. It implements the Map interface and extends HashMap class.
- It contains only unique elements.
- It may have one null key and multiple null values.
- It is same as HashMap instead maintains insertion order.
Hierarchy of LinkedHashMap class:
Example of LinkedHashMap class:
Output:100 Amit 101 Vijay 103 Rahul
No comments:
Post a Comment