This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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 ?

Ranjith Suranga
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.
Ranjith Suranga
Ranch Hand

Joined: Oct 28, 2012
Posts: 84
Hey, Isn't this exception ? Is this an error... ?
Ranjith Suranga
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: 38033
    
  22
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.
 
wood burning stoves
 
subject: I Wonder How To Catch This Exception ?
 
Similar Threads
Where method overloading sequence has refereed in JLS ?
Thread's run() sequence
Finally block executing before catch PRoblem
A simple sample of FileStreams
help with code!