比如如下,我想改key=two 的值"2-cpu",怎么改? 注意:是直接改!怎么个改法?
HashMap hm = new HashMap();
hm.put("one","1-cpu");
hm.put("two","2-cpu");
hm.put("thrid","3-cpu");
HashMap hm = new HashMap();
hm.put("one","1-cpu");
hm.put("two","2-cpu");
hm.put("thrid","3-cpu");
public Object put(Object key,Object value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.
当"映射关键字"一样的时候,新的值就会覆盖旧的值.