Package java.util
Interface Map

Public Method put

abstract Object put(Object key, Object value)

_INSERT_METHOD_SIGNATURE_HERE_

Description:

Associates the specified value with the specified key in this map (optionsl operation).

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

Note that basic types cannot be used with this method because they are not of type object. If you want to map e.g. to an integer use the Integer class, see the HashMap example below.

Example

Map vehicles = new HashMap(); // HashMap implemnts Map

vehicles.put("Train", new Integer(10)); // create an Integer-object