HashMap<String, String[]> content = new HashMap<String, String[]>();
content.put("Help", new String[]{"About"});
content.put("View", new String[]{"Grid"});
content.put("File", new String[]{"Import", "Export"});
for(String key : content.keySet()){
System.out.println(key);
}
上面的代码日志:
View
Help
File
但是为什么要排序呢?