• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception Propagation

 
Dattatraya Baravkar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic