Map Interface

  • Map interface is the not the child interface of collection interface.
  • If you want to represent a group of objects as key value pair then we should go for map interface.
  • In map both key and values can be objects.
  • In map duplicate keys are not allowed but values can be duplicate.
  • Dictionary class, Hashtable and Properties class can in java 1.0 version.
  • Map, HashMap and WeakHashMap came in java 1.2 version.
  • IdentityHashMap and LinkedHashMap came in java 1.4 version.
  • Dictionary class, Hashtable and Properties class can in java 1.0 version hence they are considered as legacy classes.

Implementation Class of Map interface :

  • HashMap
  • LinkedHashMap extends HashMap
  • WeakHashMap
  • IdentityHashMap
  • Hashtable extends Dictionary
  • Properties extends Hashtable

Features of Map :

  • When we need to represent data in the form of Key value paid then we should go for map

Leave a Comment