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);
}
Run Code Online (Sandbox Code Playgroud)
上面的代码记录:
View
Help
File
Run Code Online (Sandbox Code Playgroud)
但为什么这样排序?