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
What is the purpose of finalization in java programming?
What is %d in printf?
What is the basic concept of java?
What is difference between char array and string?
Why is the type for real numbers called double?
What are the disadvantages of object oriented programming?
What causes memory leaks in java?
Difference between object instantiation and construction ?
Why do we use string?
What is math floor in java?
What is methods and methodology?
Is a method a function?
What is a protected void?
Why arraylist is not synchronized in java example?
Who found java?