// Create a hash map
Map map = new HashMap();
// Add key/value pairs to the map
map.put("a", new Integer(1));
map.put("b", new Integer(2));
map.put("c", new Integer(3));
// remove method returns the value of removed key
oldValue = map.remove("c"); // 3
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment