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 constants and how to create constants in java?

730


Why constructor has no return type?

819


What is the full name of java?

796


Can an integer be null java?

748


Can you call a method in a method?

748


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

845


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

1767


How many ways can you break a singleton class in java?

700


Is string is a keyword in java?

735


Explain spliterator in java8?

777


What is a key in java?

699


What is function overriding and overloading in java?

789


What are the common uses of "this" keyword in java ?

769


What’s the difference between unit, integration and functional testing?

816


Is null an object java?

733