finally block not completing normally
Statement composing the third part of a try...catch...finally block. The code within this code block will execute regardless of whether an exception was caught, or if normal execution occurred.
a keyword introducing a final execution clause to implement object clean-up for the class. class Shape { Shape( int i ) { System.out.println("Shape constructor"); } void dispose() { System.out.println("Shape dispose"); } } public class CADSystem extends Shape { ... public static void main( String[] args ) { Shape x = new Shape(47); try { // code that implements the CAD system using Shape x... } finally { x.dispose();
A Java keyword that executes a block of statements regardless of whether a Java Exception, or run time error, occurred in a block defined previously by the try keyword.
The keyword finally denotes a block of code that will always be executed (assuming the application has not been terminated) following a try block. The code block denoted by finally is executed whether an exception was thrown within the try block or not. Check out this node for more information on exception handling.
This keyword introduces the finally block of a try/ catch/ finally construct. catch and finally blocks provide exception handling and routine cleanup for code in a try block. The finally block is optional, and appears after the try block, and after zero or more catch blocks. The code in a finally block is executed once, regardless of how the code in the try block executes. In normal execution, control reaches the end of the try block and proceeds to the finally block, which generally performs any necessary cleanup.