Wednesday, 26 June 2013

Insight Finally

Note: All this data has been copied from various sources for the purpose of knowledge sharing. Data content  can be either as it is or with little modification.
---------------------------------------------------------------------------------------------------------------------

the finally block is reached immediately after processing completes. In this way, the finally block can be used to ensure that some logic is always executed before the method is exited.The finally block is useful for cleaning up any resources allocated in the try block. Control is always passed to the finally block regardless of how the try block exits. This statement takes the following form.Whereas catch is used to handle exceptions that occur in a statement block, finally is used to guarantee a statement block of code executes regardless of how the preceding try block is exited.

No comments:

Post a Comment