import java.nio.file.Path; import java.nio.file.Paths; Path filePath = Paths.get("C:/Users/username/Documents/file.txt");
import java.nio.file.Path; import java.nio.file.Paths; Path path1 = Paths.get("C:/Users/username/Documents"); Path path2 = Paths.get("file.txt"); Path combinedPath = path1.resolve(path2);
import java.net.URI; import java.nio.file.Path; import java.nio.file.Paths; URI uri = URI.create("file:///C:/Users/username/Documents/file.txt"); Path path = Paths.get(uri);The java.nio.file.Paths class is part of the java.nio.file package in Java, which is located in the Java SE Development Kit (JDK) 7 or later.