The finally keyword is used to define a block that is always executed in a tryâcatchâfinally statement.
A finally block typically contains cleanup code that recovers from partial execution of a try block.
If any portion of the try block is executed, the code in a finally block is always guaranteed to be executed whether an exception occurs or not and independent of whether the try or catch blocks contain return, continue or break statements.Syntax:
catch ( e)
// code that throws an exception
int zero = 0;
Console.WriteLine("In try block: attempting division by zero");
int myInt = 1 / zero; // throws the exception
Console.WriteLine("You never see this message!");
// code that handles the exception
Console.WriteLine("In catch block: an exception was thrown");
// code that does any cleaning up
Console.WriteLine("In finally block: do any cleaning up here");
Java Enterprise Edition (EE)
Java Standard Edition (SE)
RFC (standard status)
RFC (proposed standard status)
RFC (draft standard status)
RFC (informational status)
RFC (experimental status)
RFC (best current practice status)
RFC (historic status)
RFC (unknown status)
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 80 / 158862566. Delta: 0.00305 с