Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes I Wonder How To Catch This Exception ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I Wonder How To Catch This Exception ?" Watch "I Wonder How To Catch This Exception ?" New topic
Author

I Wonder How To Catch This Exception ?

Ranji Sura
Ranch Hand

Joined: Oct 28, 2012
Posts: 84
Hi, I have got this code in my class. I have tried to catch the exception here, but i am still not able to do it so.. Could you please help me... ?

These are the methods which I have tried to catch the exception.. Non of them work in this case.. I don't know why... ?


Thank You.
Ranji Sura
Ranch Hand

Joined: Oct 28, 2012
Posts: 84
Hey, Isn't this exception ? Is this an error... ?
Ranji Sura
Ranch Hand

Joined: Oct 28, 2012
Posts: 84
OK. I tried this and it works.. It is not an exception, It is an error, I think...


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
Never catch Errors (unless you are simply seeing what happens if…).

I would rather say, “What Exception?” I can’t see anything which produces a bona fide Exception in your code.
You are recursively calling a method with no base case, so your recursion will go on for ever (or more precisely until you exhaust the available stack memory), but that is a different design mistake.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I Wonder How To Catch This Exception ?