| 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
|
|
|
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
|
|
|
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3791
|
|
|
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
|
 |
 |
|
|
subject: Regarding Exceptions
|
|
|