Sunday, January 16, 2011

Map interface

1-An object that maps keys to values. 
2-A map cannot contain duplicate keys;
3-each key can map to at most one value.
4-both the key and the value are objects.
5-The Map interface is provide three collection view
  1-collections of value
  2-set of keys
  3-set of key -value mappings
6-Four main classes which are implemented the Map interface
  1-HashMap
  2-Hashtable
  3-LinkedHashMap
  4-TreeMap
7-All general-purpose map implementation classes should provide two "standard"   constructors:
   1-a void (no arguments) constructor which creates an empty map
   2-a constructor with a single argument of type Map,
   3-which creates a new map with the same key-value mappings as its argument.
8-method in this interface
   1-  boolean containsKey(Object key);
   2-boolean containsValue(Object value);
   3-V get(Object key);
   4-V put(K key, V value);
   5-V setValue(V value);
   6-V getValue();
   7-boolean equals(Object o);
   8-int hashCode();