Package java.util
Class HashMap
Description:
Returns a shallow copy of this Hashmap instance. The keys and values themselves are not cloned.
Example
HashMap map1 = new HashMap();
HashMap map2 = new HashMap();
Integer i = new Integer(0);
map1.put(i, "value");
map2 =(HashMap)map1.clone();
Logger.log("Map1 element: " + map1.get(i));
Logger.log("Map2 element: " + map2.get(i));
map1.clear();
Logger.log("Map1 element: " + map1.get(i));
Logger.log("Map2 element: " + map2.get(i));
The example above clears the new created map and writes the result to the logger.