Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Java 8 in Action this week in the Java 8 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: 36590
    
  16
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 ?
 
Similar Threads
A simple sample of FileStreams
Thread's run() sequence
Where method overloading sequence has refereed in JLS ?
Finally block executing before catch PRoblem
help with code!