标签:code ash entryset 表达 value string while print key
Iterator item = tempMap.entrySet().iterator(); while (item.hasNext()){ Map.Entry entry = (Map.Entry)item.next(); String key = entry.getKey().toString(); Integer value =(Integer)entry.getValue(); System.out.println("key:"+key+";value:"+value); }
for (Map.Entry<String,Integer> entry : tempMap.entrySet()){ String key = entry.getKey().toString(); Integer value =(Integer)entry.getValue(); System.out.println("key:"+key+";value:"+value); }
Iterator i = tempMap.keySet().iterator(); while (i.hasNext()){ Object obj = i.next(); String key = obj.toString(); Integer value =tempMap.get(key); System.out.println("key:"+key+";value:"+value); }
for ( Object obj: tempMap.keySet()){ String key = obj.toString(); Integer value =tempMap.get(key); System.out.println("key:"+key+";value:"+value); }
tempMap.forEach((k, v)->{ System.out.println("key:"+k+";value:"+v); });
标签:code ash entryset 表达 value string while print key
原文地址:https://www.cnblogs.com/chongxinchufa/p/9125450.html