Java IO Tutorial - Java Path.resolve(Path other)








Syntax

Path.resolve(Path other) has the following syntax.

Path resolve(Path other)

Example

In the following code shows how to use Path.resolve(Path other) method.

/*from www.  j  a v a 2 s .  co  m*/
import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {

  public static void main(String[] args) {
     Path path = Paths.get("C:/home/./music/users.txt");
     Path path1 = Paths.get("./music/users.txt");
     System.out.println(path.resolve(path1).normalize());

  }
}

The code above generates the following result.