标签:col put mamicode loading 方式 遍历 alt keyset ash
HashMap<String, String> hashMap = new HashMap<>(); hashMap.put("001","张飞"); hashMap.put("002","关于"); hashMap.put("003","赵云"); Set<String> stringSet = hashMap.keySet(); for (String key:stringSet){ System.out.println(key+":"+hashMap.get(key)); }
Set<Map.Entry<String, String>> entries = hashMap.entrySet(); for (Map.Entry<String, String> m:entries){ System.out.println(m.getKey()+":"+m.getValue()); }
标签:col put mamicode loading 方式 遍历 alt keyset ash
原文地址:https://www.cnblogs.com/luzhanshi/p/13166662.html