Package java.util
Class HashMap

Public Method put

Object put(Object key, Object val)

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

   HashMap map = new HashMap();
   Integer i = new Integer(0);
   map.put(i, "value");
   Logger.log("Initial map elements: " + map.get(i));

The example above creates a new map, puts a value into and writes the result to the logger.