When an exception occurs within a method, the control flow defined by Java can take several forms.
If an exception occurs outside a try..catch block, the exception simply propagates “up” to the caller.
If an exception occurs inside a try..catch block, then the control flow can take different forms. Here are the cases, along with indicators for which code blocks are included in the control flow:
Here, “bottom” refers simply to any code which follows the finally block, as shown here :
final class Bottom { void doStuff() { try { //..elided } catch( Exception ex ) { //..elided } finally { //..elided } //any code appearing here, after the finally //block, is "bottom" code } }
Leave A Comment