- Map的正确循环调用
for(Map.Entry<String, String> entry: params.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); }
Iterator<Entry<UserEntity, Long>> iter = countTaskOfUserMap.entrySet().iterator(); while(iter.hasNext()){ Map.Entry entry = (Map.Entry)iter.next(); UserEntity key = (UserEntity)entry.getKey(); long value = (Long)entry.getValue(); }