What is the purpose of the finally clause?
Answers were Sorted based on User's Feedback
Answer / dhawal
the code block in finally block must be executed if
exception throws or not,except if we write system.exit(0);
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ranganathkini
The finally clause is used to ensure that a single statement
or a set of statements are executed irrespective of whether
or not an exception is thrown/caught inside a method.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ravikiran
finally clause is used to get executed irrespective of the
exception raising inorder to conserve the resources
| Is This Answer Correct ? | 3 Yes | 1 No |
How does synchronized modifier work?
What is the ResourceBundle?
2 Answers Elementus Technologies,
There can be a abstract class without abstract methods, but what is the need to declare a class abstract if it doesn't contain abstract methods?
What is oops in java?
Why are pointers not secure?
what is the Use of throws exception?
Why all programming languages have main as a execution starting point?
What are reference variables in java?
Compare java and python.
What is the difference between iterator and list iterator?
Explain jvm, jre, and jdk?
can we write two same methods in outer class and innerclass.