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
Explain notifyall() method of object class ?
Difference between serialization and deserialization in java?
Can an interface have a class?
What do you understand by Header linked List?
Variables used in a switch statement can be used with which datatypes?
What is the main purpose of serialization in java?
Why static functions are used?
What is the meaning of find and replace?
What is boolean query?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
What restrictions are placed on method overloading?
Can a constructor call the constructor of parent class?
What does main method?
What is downcasting?
What is the difference between length and length() method in java?