1.

What happens when an exception is thrown from the top of the stack in Java?

Answer»

When an EXCEPTION is thrown from the TOP of the stack, exception propagation OCCURS. Here are some of the points when the exception is not caught:

  • The exception drops down the call stack of the PRECEDING METHOD.
  • If it is still not caught there itself, it further goes down to the preceding method.
  • The above goes till the method reaches the bottom of the call stack
  • This can also go on till it is caught somewhere in between.


Discussion

No Comment Found