如果HashMap的键是一个字符串数组:
HashMap<String[], String> pathMap;
Run Code Online (Sandbox Code Playgroud)
您可以使用新创建的字符串数组访问地图,还是必须是相同的String []对象?
pathMap = new HashMap<>(new String[] { "korey", "docs" }, "/home/korey/docs");
String path = pathMap.get(new String[] { "korey", "docs" });
Run Code Online (Sandbox Code Playgroud)