September 2019
Intermediate to advanced
816 pages
18h 47m
English
Creating an absolute path can be accomplished by explicitly specifying the root directory and all other subdirectories that contain the file or folder, as shown in the following examples (C:\learning\packt\JavaModernChallenge.pdf):
Path path = Paths.get("C:/learning/packt", "JavaModernChallenge.pdf");Path path = Paths.get( "C:", "learning/packt", "JavaModernChallenge.pdf");Path path = Paths.get( "C:", "learning", "packt", "JavaModernChallenge.pdf");Path path = Paths.get("C:/learning/packt/JavaModernChallenge.pdf");Path path = Paths.get( System.getProperty("user.home"), "downloads", "chess.exe");Path path = Path.of( "C:", "learning/packt", "JavaModernChallenge.pdf");Path path = Path.of( System.getProperty("user.home"), ...