What is the use of having finally?

This question is related to Oracle Interview

Showing Answers 1 - 3 of 3 Answers


  • Dec 24th, 2012

Finally is the block which will be executed irrespective of exception caught in catch block.
Hence it is useful to do any resource releasing/ connection closing after exception handling

  Was this answer useful?  Yes

Finally block having the statements which are releasing the resource, closing the streams, closing the connection and so on. If exception is raised or not but closing the resource are necessary. So we can keep statements inside the finally block those should be get executed compulsory.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions