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 a conditional statement explain with example?
How do you sort words in java?
Why are pointers not secure?
How destructors are defined in java?
What happens to a static var that is defined within a method of a class?
Differences between external iteration and internal iteration?
What does index mean in java?
Can you inherit a constructor java?
How do you insert a line break?
Is void a type?
Can we access the non-final local variable, inside the local inner class?
What is the main advantage of passing argument by reference?
Write a code to show a static variable?
Is string thread safe in java?
What is the map interface in java programming?