IdentityHashMap get Example
IdentityHashMap class get example. This example shows you how to use get method.
IdentityHashMap class get example. public Object get(Object) Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
Here is the code
/**
* @ # Get.java
* A class repersenting use to get method
* of IdentityHashMap class in java.util package
* version 26 May 2008
* author Rose India
*/
import java.util.*;
public class Get {
public static void main(String args[]) {
IdentityHashMap map = new IdentityHashMap();
//Add the mapping into the map
map.put(1, "A");
map.put(2, "A");
map.put(3, "B");
System.out.println("Map " + map);
System.out.println(map.get(1));
}
} |
|