File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Exception Propagation

Dattatraya Baravkar

Joined: Jan 24, 2008
Posts: 10
Please tell me How the Exception is propagated through out the
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.

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.
I agree. Here's the link:
subject: Exception Propagation
It's not a secret anymore!