aspose file tools
The moose likes Beginning Java and the fly likes Regarding Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Regarding Exceptions" Watch "Regarding Exceptions" New topic
Author

Regarding Exceptions

shobha devi
Greenhorn

Joined: Mar 11, 2009
Posts: 11
Suppose if a program throws an exception and the appropriate exception handler starts its execution. If exception handler itself throws the same exception. Does this create an infinite recursion?

Please help
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14670
    
  11

No. The exception is thrown away, and if necessary, has to be caught by another try/catch.


[My Blog]
All roads lead to JavaRanch
shobha devi
Greenhorn

Joined: Mar 11, 2009
Posts: 11
can you please explain with code snippet
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32644
    
    4
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3791
    
    1

Basically, the exception is handled only if it occurs within the try block. If there's an exception in the catch block it gets thrown to the next level up.
shobha devi
Greenhorn

Joined: Mar 11, 2009
Posts: 11

@Campbell Ritchie,Matthew Brown,Christophe Verré:thank you so much

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Regarding Exceptions
 
Similar Threads
throws and catch
Exception concept clarification -help!
exceptions:catch or specify requirement
never understood a checked exception
Exception Doubt