How does an exception permeate through the code? Ans. An unhandled exception moves up the method stack in search of a matching When an exception is thrown from a code which is wrapped in a try block followed by one or more catch blocks, a search is made for matching catch block. If a matching type is found then that block will be invoked. If a matching type is not found then the exception moves up the method stack and reaches the caller method. Same procedure is repeated if the caller method is included in a try catch block. This process continues until a catch block handling the appropriate type of exception is found. If it does not find such a block then finally the program terminates. - Study24x7
Social learning Network
04 Dec 2023 11:36 AM study24x7 study24x7

How does an exception permeate through the code? Ans. An unhandled exception moves up the method stack in search of a matching When an exception is thrown from a code which is wrapped in a try block followed by one or more catch blocks, a search is made for matching catch block....

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles