1.

How does an exception propagate in the code?

Answer»

When an exception occurs, first it searches to locate the matching CATCH BLOCK. In case, the matching catch block is located, then that block would be executed. Else, the exception propagates through the METHOD call stack and goes into the caller method where the PROCESS of matching the catch block is performed. This propagation happens until the matching catch block is found. If the match is not found, then the program gets terminated in the main method.



Discussion

No Comment Found