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

Answer Posted / reshma

Using finally one can close the resources such as file
handler or a database connection. It ia good to maintain
the internal state of an object.

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we declare a class as static?

586


What is stack class in java?

535


Explain garbage collection in java?

537


What are the types of strings?

553


What do you mean by chromounits in java8?

520






What is time complexity algorithm?

540


Why are data types important?

530


Differentiate storage classes on the basis of their scope?

664


What is the difference between replace and replace all?

463


Why do we need autoboxing in java?

510


Can you change array size in java?

524


What do you understand by the bean persistent property?

547


What are the differences between the constructors and methods?

567


What is Classloader in Java?

628


Can we sort array in java?

520