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

Answer Posted / sivadasan

Finally block always execute, its not consider whether an
exception is raised or not. Once try block is executed
means finally will be executed.

Finally block is necessary, often sufficient to execute
some important things its nothing but connection close
stmt..

system.exit(0); given in try catch block means finally
block will not be executed.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does linkedlist work in java?

501


What does those terms actually mean included in the j.d.k i.6?

1593


What is api in java?

528


Why java is used everywhere?

584


What programs use java?

464






What is arrays aslist in java?

509


what is the purpose of using rmisecuritymanager in rmi?

560


What are the features in java?

572


Can we sort arraylist in java?

555


Why can't we use static class instead of singleton?

494


What is json parser in java?

606


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

544


What is a class component?

599


How would you dynamically allocate memory to an array?

580


What is the epoch date?

564