编程语言
首页 > 编程语言> > java容器的使用

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

 

标签:容器,java,Map,entrySet,iter,getValue,Entry,使用,entry
来源: https://www.cnblogs.com/dukedu/p/15250334.html