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 line separator in java?
what do you mean by stream pipelining in java 8? Explain
What is factor r?
What is the java reflection api? Why it’s so important to have?
How to perform merge sort in java?
What is style and indentation?
What is the role of the java.rmi.naming class?
Can a class with private constructor be extended?
What is indexof in java?
What is the importance of main method in Java?
What is collection api?
What is a java lambda expression?
Is 0 true or false in java?
What is the difference between static class and normal class?
design an lru cache in java?