import java.nio.file.Path;
import java.nio.file.Paths;

public class JI9030300 {

	public static void main(String[] args) {
		 String userHome = System.getProperty("user.home"); 
		 System.out.println(userHome);
	        Path absoluteBase = Paths.get(userHome); 
	        Path absoluteFile = Paths.get(userHome, "absoluteFile.txt"); 

	        Path relativeFile = absoluteBase.relativize(absoluteFile); 
	        Path subPathFile = absoluteFile.subpath(absoluteFile.getNameCount() - 1, absoluteFile.getNameCount()); 
	        Path namePathFile = absoluteFile.getName(absoluteBase.getNameCount()); 

	        printRelativeAndAbsoluteStrings(relativeFile, "relative file"); 
	        printRelativeAndAbsoluteStrings(subPathFile, "subPath file"); 
	        printRelativeAndAbsoluteStrings(namePathFile, "namePath file"); 
	    } 

	    public static void printRelativeAndAbsoluteStrings(Path path, String name) { 
	        System.out.println("Printing " + name); 
	        System.out.println("\tRelative path: " + path.toString()); 
	        System.out.println("\tAbsolute Path: " + path.toAbsolutePath().toString()); 
	    } 
	}

