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 are the differences between forwarding () method and sendredirect() methods?
What is get () in java?
Can we have multiple classes in a single file?
Can we write any code after throw statement?
Why scanner is used in java?
How many characters is 2 bytes?
I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in
Which access specifier can be used with class ?
What does snprintf return?
What is a variable analysis?
Name few java 8 annotations ?
What is the effect of keeping a constructor private?
Can a serialized object be transferred via network?
What is the abstraction?
What is the difference between an if statement and a switch statement?