java.util.ConcurrentModificationException???报错了吧
这里是解决方法。。。。
Map map=new HashMap();
map.put("key1","value1");
map.put("key2","value2");
map.put("key3","value3");
Iterator<Entry<Object, Object>> it = map.entrySet().iterator();
while(it.hasNext()){
Entry<Object, Object> itEntry = it.next();
Object itKey = itEntry.getKey();
Object itValue = itEntry.getValue();
System.out.println("key:" + itKey + " value:" + itValue);
//注意:
//修改元素
itEntry.setValue("ttt");
//删除元素
it.remove();
}