What is finally in exception handling?

Answer Posted / rizwana

The finally keyword can be used to provide a block of code
that is performed regardless of whether an exception is
signaled or not. The syntax is:
try
{
// tested statement(s);
}
catch (ExceptionName e1)
{
// trap handler statement(s);
}
catch (ExceptionName e2) // any number of catch statements
{
// display exception to screen
System.out.println("Exception: " + e2);
}
finally
{
// always executed block
}

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are streams in java 8?

552


What is the final blank variable?

600


Is null a string or object in java?

556


What are different types of multitasking?

555


What is java abstraction with example?

563






When a byte datatype is used?

575


Can we override the static method?

582


What is the meaning of flag day?

550


What are the advantages of java?

519


Do I need to import java.lang package any time? Why?

745


Explain java coding standards for methods?

616


What are the restrictions that are applied to the java static methods?

534


What is meant by the value of a variable?

462


Is java call by reference?

536


What is jee6?

544