Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileNotFoundException and NoSuchFileException

 
meeta gaur
Ranch Hand
Posts: 305
Notepad Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

java.io.FileNotFoundException: xanadu.txt (The system cannot find the file specified)


http://www.coderanch.com/t/558721//java/java-io-FileNotFoundException-java-nio
According to this thread my program should throw NoSuchFileException because that file does not exist.
 
Tony Docherty
Bartender
Posts: 2989
59
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always read the API docs.

NoSuchFileException is thrown by classes in the java.nio package but FileInputStream is part of the java.io package and not the java.nio package.

 
meeta gaur
Ranch Hand
Posts: 305
Notepad Tomcat Server Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic