Create a Path object using FileSystems in Java
Description
The following code shows how to create a Path object using FileSystems.
Example
import java.nio.file.FileSystems;
import java.nio.file.Path;
//ww w . j a v a 2s . c om
public class Main {
public static void main(String[] args) {
Path path = FileSystems.getDefault().getPath("/home/docs/status.txt");
System.out.println(path);
}
}
The code above generates the following result.