测试用例:
public class Test {
public static void main(String[] args) throws NoSuchAlgorithmException {
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("语文", 1);
map.put("数学", 2);
map.put("英语", 3);
map.put("历史", 4);
map.put("政治", 5);
map.put("地理", 6);
map.put("生物", 7);
map.put("化学", 8);
for (Map.Entry<String, Integer> entry : map.entrySet()) {
System.out.println(entry.getKey() + ": " + entry.getValue());
}
}
}
在System.out.println(map)处打一个断点,
并不是我们想要的结果,
取消勾选Enable alternative view for Collections classes.
效果:
转自:http://www.cnblogs.com/winner-0715/p/6963655.html