What is the purpose of the finally clause?

Answers were Sorted based on User's Feedback



What is the purpose of the finally clause?..

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

What is the purpose of the finally clause?..

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

What is the purpose of the finally clause?..

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

Post New Answer

More Core Java Interview Questions

How to use arraylist in java netbeans?

0 Answers  


What is the new line character?

0 Answers  


Can a class have an interface?

0 Answers  


What is the specification of ?CODEBASE? in an applet?

1 Answers  


What is a superclass?

0 Answers  






What is the difference between static and non-static variables?

6 Answers  


What exceptions occur during serialization?

0 Answers  


How finally used under exception handling?

0 Answers  


Can we extend private class in java?

0 Answers  


Which class has no duplicate elements?

8 Answers  


What is the difference between equals() and == in java?

0 Answers  


How many bits are in a sentence?

0 Answers  


Categories