This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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: 14911

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!