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

No exception thrown

 
Shailesh Phatak
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello EveryOne,
I read in k & b book that if we don't make a directory using mkdir() function and add a file in it then it will throw an exception But the below code executes fine. Though it doesn't output anything..

This code doesn't throw any exception but according to book it have to throw.
Note: There is no Directory named First Directory in my pC
 
Henry Wong
author
Marshal
Pie
Posts: 21216
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shailesh Phatak wrote:This code doesn't throw any exception but according to book it have to throw.
Note: There is no Directory named First Directory in my pC


How do you know it doesn't throw any exceptions? Any exception thrown will be quietly caught and ignored in your code.

Or are you saying that you were able to write out the sentence, read it back, and print it?

Henry
 
Shailesh Phatak
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops!! I have to test it again!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic