Java tutorial
import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) { //define the fix path Path base_1 = Paths.get("C:/tutorial/Java/JavaFX"); Path base_2 = Paths.get("C:/tutorial/Java/JavaFX/Topic.txt"); //resolve Topic.txt file Path path_1 = base_1.resolve("Topic.txt"); System.out.println(path_1.toString()); //resolve Demo.txt file Path path_2 = base_1.resolve("Demo.txt"); System.out.println(path_2.toString()); } }