source code IdentityHashMap
package myutil;
import java.util.IdentityHashMap;
public class IdentityHashMapEx1 {
public static void main(String... args) {
IdentityHashMap map=new IdentityHashMap ();
Integer i1=new Integer(10);
Integer i2=new Integer(10);
map.put(i1,"orange");
map.put(i2,"apple");
System.out.println("The Map"+map);
}
}
output:
The Map{10=apple, 10=orange}
0 comments:
Post a Comment