java容器的使用

  1. 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();      
   }      

 

上一篇:性能测试指标


下一篇:2021-09-08