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
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
Is java developer a good career?
Why main method is called first in java?
What are parsing rules?
What is the use of using enum to declare a constant?
What is meant by structural programming?
What is the basic concepts of OOPS?
What is the generic function?
What is a java lambda expression?
What is the properties class?
Can size_t be negative?
Can you start a thread twice in Java?
How many bytes is a string in java?
Can we define private and protected modifiers for variables in interfaces?
What is the main purpose of serialization in java?