Package java.util
Class TreeMap

Public Method put

Object put(Object key, Object value)

Overrides:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.

Example

   TreeMap treeMap = new TreeMap();
   treeMap.put("1", "T");
   treeMap.put("2", "r");
   treeMap.put("3", "e");
   treeMap.put("4", "e");
   treeMap.put("5", "M");
   treeMap.put("6", "a");
   treeMap.put("7", "p");

The example above puts seven elements with the according keys in this map.