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 restrictions are placed on method overriding in java programming?
Explain illegalmonitorstateexception and when it will be thrown?
What is linkedlist in java?
Is there a jre for java 11?
Does a class inherit the constructors of its superclass in java programming?
What does snprintf return?
Which class cannot be a subclass in java?
What is the difference between a synchronized method and a synchronized block?
What do you mean by constructor?
Define linked list and its features with signature?
Can an interface have a class?
Give reasons supporting that string is immutable.
Can a class be private in java?
how is final different from finally and finalize in java?
What are the new features in java 8?