IT. Expert System.

Java basics

finally


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:
try
{

}
catch ( e)
{

}
finally
{

}


Example:

try
    {

      // 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!");

    }
    catch
    {

      // code that handles the exception
      Console.WriteLine("In catch block: an exception was thrown");

    }
    finally
    {

      // code that does any cleaning up
      Console.WriteLine("In finally block: do any cleaning up here");

    }


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

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)

IT dictionary

License.
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 с