What is the basically use of finally while we know it
is always executed but why?

Answer Posted / muffy.jad@gmail.com

The finally block is used to ensure resources are recovered
regardless of any problems that may occur.

finally is important because it allows the programmer to
guarantee the release of memory regardless of what happens
in the try block

finally is necessary when you need to set something other
than memory back to its original state.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is generic class?

640


What is java full form?

520


Tell some latest versions in JAVA related areas?

550


What is method overloading and method overriding?

531


When do we use hashset over treeset?

523






What is final keyword in java? Give an example.

574


What is the use of conditional statement?

556


What are dot operator queries?

621


What do you understand by java virtual machine?

700


Can a constructor be private and how are this() and super() method used with constructor?

518


What is the advantage of functional interface in java 8?

511


How can we make a class virtual?

634


How do I get the | symbol on my keyboard?

585


What is json parser in java?

607


Java is pass by value or pass by reference? Explain

528