what is the purpose of the final in the try-catch-final
Answer Posted / guest
finally will execute after catch block if try throw
exception else it will execute after try.
ex:
class a
{
public static void main(String []asd)
{
try
{
throw new Exception();
}catch(Exception e)
{
System.out.println("catch");
}
finally{
System.out.println("finally");
}
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Why object class is super class for every class in java?
what is the purpose of using rmisecuritymanager in rmi?
What is class forname used for?
Describe string intern() methodology
What are data structures in java?
Can we declare array without size in java?
How are observer and observable used in java programming?
What is boolean law?
Why main method is called first in java?
What is ide with example?
What is the use of optional ?
Why can't we make a class private in java?
Is map ordered in java?
What steps are taken when the OS shifts from one-thread execution to another?
Why is the type for real numbers called double?