Map<String, String> map = new HashMap<String, String>();
map.put("xiaocui1", "gongchen");
map.put("xiaocui2", "daima");
map.put("xiaocui3", "xuexi");
map.put("xiaocui4", "dagong");
System.out.println(map.keySet());
输出:
[xiaocui4, xiaocui1, xiaocui2, xiaocui3]