Why there is no Path constructor in java.nio.files.Path?
问题 The Path class has no documented constructor, but one creates instances via. Paths.get( "...." ) which is a shorthand for FileSystems.getDefault().getPath( "..." ) . So can someone explain this design decission? 回答1: can someone explain this design decision? It is because JSR 203 allows paths to be issued from more than one FileSystem, unlike File , which is always linked to the file system the JVM lives on. In JSR 203, this filesystem is called the default filesystem . You can get a