Map<String, String> map = new HashMap<String, String>();
map.put("1", "value1");
map.put("2", "value2");
map.put("3", "value3");
遍历map方式
1:Map.entrySet迭代器
for (Map.Entry<String, String> entry : map)) {
System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue());
}
标签:Map,Java,map,Entry,put,entry
From: https://www.cnblogs.com/wdnmdp/p/16751165.html