In Java, a Map is a kind of generalized array. It provides a more general way of storing elements. It is an object that maps keys to values. Map is not an extension of the collection interface rather it has own interface hierarchy. Map provides a more general way for storing elements and does not contain duplicate keys. It allows you to store pairs of elements, termed "keys" and "values", where each key maps to one value. Thus the keys in a map must be unique. Maps are defined by the interface java.util.Map, which includes put and get methods as well as other general methods for working with maps.
Java includes two classes that implement the Map interface: TreeMap, HashMap, and LinkedHashMap.
Read more at:
Posted on: November 16, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles