aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes No exception thrown 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 "No exception thrown" Watch "No exception thrown" New topic
Author

No exception thrown

Shailesh Phatak
Ranch Hand

Joined: Aug 27, 2009
Posts: 64
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

See Dreams With Open Eyes And Make It Real
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18990
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Shailesh Phatak
Ranch Hand

Joined: Aug 27, 2009
Posts: 64
Oops!! I have to test it again!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No exception thrown