Home Segments Top Top Previous Next

618: Mainline

Occasionally, you may want to have a block of statements executed after a try statement, whether or not an exception is thrown, activating a catch block.

Accordingly, Java provides for finally blocks, which are executed after the try block is executed, along with any catch block that happens to be executed:

try { 
 ... 
}        
catch (exception-class name e) { 
 ...                      
}                         
finally { 
 clean up statements 
}