JAVA中Map集合遍历

时间:2021-09-03 18:10:54   收藏:0   阅读:29

 

 

for (Map.Entry<String, String> entry : map.entrySet()) {
    System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue());
 }

 

 

   for (String key : map.keySet()) {
    System.out.println("key= "+ key + " and value= " + map.get(key));
   }

 

原文:https://www.cnblogs.com/pxblog/p/15221632.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!