MapEntry

阅读更多
Map map = new HashMap();
map.put("a", "A");
map.put("b", "B");
map.put("c", "C");
map.put("d", "D");
map.put("e", "E");

//用entrySet遍历
for(Map.Entry entry : map.entrySet())
{
    System.out.println(entry.getKey());//get map's key 
    System.out.println(entry.getValue());//get map's value
}

 

 

你可能感兴趣的:(map.entrySet())