Map Classes in java.util

Here are the map classes in java.util:

HashMap Class: HashMap Class implements Map interface by using hash table. It extends AbstractMap class. There is no order followed by the elements of Hashmap.

TreeMap Class: TreeMap Class implements SortedMap and is used to store key and value pairs in a sorted ascending order of keys. It extends AbstractMap class. TreeMap provides fast access and retrieval of values.

LinkedHashMap Class: LinkedHashMap Class creates a linked list of entries in a map. It extends the HashMap class.

AbstractMap class: It is used to implement the Map interface.

WeakHashMap class: It is uses a hash table with weak keys. It extends AbstractMap class.

IdentityHashMap class: It uses reference equality to compare documents. It extends AbstractMap class.

Leave a Reply