Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IO doubt?

 
pras
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15358
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the API documentation, and write a small test program to try it out for yourself to see what happens.
 
pras
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic