I think I passed the reference of value to hashmap,then after I change the value outside,the value in the hashmap should also be changed.
Integer key=new Integer(0);
Integer value=new Integer(3);
HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>();
hm.put(key, value);
System.out.println(hm.get(key));
value=null;
System.out.println(hm.get(key));