Test.java Source code

Java tutorial

Introduction

Here is the source code for Test.java

Source

import java.nio.file.Path;
import java.nio.file.Paths;

public class Test {

    public static void main(String[] args) {
        Path firstPath = Paths.get("music/A.mp3");
        Path secondPath = Paths.get("docs");

        System.out.println("From firstPath to secondPath: " + firstPath.relativize(secondPath));
        System.out.println("From secondPath to firstPath: " + secondPath.relativize(firstPath));
        System.out.println();

    }
}