HashMap遍历的两种方法
Map map = new HashMap();for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); Object key = entry.getKey(); Object val = entry.getValue();}
Map map = new HashMap();for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { Object key = iter.next(); Object val = map.get(key);}