File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes IO doubt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "IO doubt?" Watch "IO doubt?" New topic

IO doubt?

Ranch Hand

Joined: Apr 04, 2007
Posts: 188
suppose i have "dir1" which has "file1.txt" and "dir2" which has "file2.txt"
in it.

now say File file=new File(dir1,file2.txt);

what will file.isFile() return
what will file.exists() return

will isFile return true if there is no file of name we are searching for in the particular directory?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15083

Read the API documentation, and write a small test program to try it out for yourself to see what happens.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
got it thanks
I agree. Here's the link:
subject: IO doubt?
It's not a secret anymore!