<<< try/catch/finally rules | Index | Order of catch blocks >>> |
If no exception is thrown in a try block, all catch blocks associated with the try block are ignored and program execution resumes after the last catch block
If an exception is thrown in a try block,
the remaining statements in the try block are ignored
The program searches the catch blocks in the order in which they appear after the try block, searching for an appropriate exception handler
If the type of the thrown exception matches the parameter type in one of the catch blocks, the code of that catch block executes and the remaining catch blocks after the matching catch block are ignored
If there is a finally block after the last catch block, the finally block executes regardless of whether an exception occurs.
<<< try/catch/finally rules | Index | Order of catch blocks >>> |