I created c:\book\chapter1 and run the following code,
it produced output as;
C:\CLASSES>
java rat
true
true
C:\CLASSES>
import java.io.*;
public class rat
{
public static void main(String args[])
{
File f = new File("c:\\book\\chapter1");
if(f.exists())
System.out.println("true");
if(f.isDirectory())
System.out.println("true");
f.getName();
}
}