PathInfo.java Source code

Java tutorial

Introduction

Here is the source code for PathInfo.java

Source

import java.io.File;
import java.io.IOException;

class PathInfo {
    public static void main(String[] args) throws IOException {

        File f = new File(args[0]);

        System.out.println("Absolute path = " + f.getAbsolutePath());
        System.out.println("Canonical path = " + f.getCanonicalPath());
        System.out.println("Name = " + f.getName());
        System.out.println("Parent = " + f.getParent());
        System.out.println("Path = " + f.getPath());
        System.out.println("Absolute? = " + f.isAbsolute());
    }
}