Map+in+Java
Map+in+Java
: Map
Interface
Collection Framework: Map
• Map interface is not a subtype of the
Collection interface. Therefore it behaves a bit
different from the rest of the collection types.
• Map store the data in Key-value pair.
• Map doesn’t store the duplicate key but value
would be.
Collection Framework: Map
• HashMap, LinkedHashMap & TreeMap are the
classes which implement Map Interface.
When use Map
• Maps are perfectly for key-value association
mapping:
Error codes and their descriptions
Zip codes and cities
Classes and students ...etc