wood burning stoves*
The moose likes Beginning Java and the fly likes Exception Propagation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exception Propagation" Watch "Exception Propagation" New topic
Author

Exception Propagation

Dattatraya Baravkar
Greenhorn

Joined: Jan 24, 2008
Posts: 10
Hi........
Ranchians.........
Please tell me How the Exception is propagated through out the
program?
What are the Checked Exception & Unchecked Exception? Please tell me the difference of 2.
Is there are 2 different ways of handling these 2?
I'm cnfused abt it,please tell me the correct answers.

Thanks in advance.

Dattatraya.
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

Exceptions propagate up through block structure of a Java method, and then up the method call stack. If an exception is not caught by the block of code that throws it, it propagates to the next higher enclosing block of code. If it is not caught there, it propagates up again. If it is not caught anywhere in the method, it propagates to the invoking method, where it again propagates through the block structure. If an exception is never caught, it propagates all the way to the main() method from which the program started, and causes the Java interpreter to print an error message and a stack trace and exit.

For checked and unchecked exception see this exception link.

Hope that helps


PS. Exception propagation explanation courtesy "Java in a Nutshell
By David Flanagan". See this link for more details.
 
jQuery in Action, 2nd edition
 
subject: Exception Propagation
 
Similar Threads
doubt in a mock exam question
Socket time out exception
what does it mean
exception
Servelt