[Oracle interview]How does an exception permeate through the code?
Anunhandled exception moves up the method stack in search of a matching When anexception is thrown from a code which is wrapped in a try block followed byone or more catch blocks, a search is made for matching catch block. If amatching type is found then that block will be invoked. If a matching type isnot found then the exception moves up the method stack and reaches the callermethod. Same procedure is repeated if the caller method is included in a trycatch block. This process continues until a catch block handling theappropriate type of exception is found. If it does not find such a block thenfinally the program terminates.
页:
[1]