//To create a file and to import io library
import java.io.File;
class filedemo
{
static void p(String s)
{
System.out.println(s);
}
public static void main(String args[])
{
File f1=new File("/java/COPYRIGHT");
p("file name:"+f1.getName());
p("path name:"+f1.getPath());
p("Abs path:"+f1.getAbsolutePath());
p("Parent:"+f1.getParent());
p(f1.exists()?"exists":"does not exist");
p(f1.canWrite()?"it is writable":"is not writable");
p(f1.canRead()?"it is readable":"is not readable");
p("is"+(f1.isDirectory()?"":"not" + "a directory"));
p(f1.isFile()?"is normal file":"might be a named pipe");
p(f1.isAbsolute()?"it is Absolute":"is not Absolute");
p("File last modified:"+f1.lastModified());
p("File size:"+f1.length()+"Bytes");
}
}