将值与具有映射的对象关联
import java.util.IdentityHashMap; import java.util.Map; /*来自 N o w J a v a . c o m*/ public class Main { public static void main(String[] args) throws Exception { Map objMap = new IdentityHashMap(); // Add the object and value pair to the map Object o1 = new Integer(123); Object o2 = new Integer(123); objMap.put(o1, "first"); objMap.put(o2, "second"); /* 来 自 nowjava - 时 代 Java*/