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
why Interface used?
Explain the differences between static and dynamic variables?
How an object is serialized in java?
How do you allocate memory to object?
Can an abstract class be a final class?
In case of inheritance what is the execution order of constructor and destructor?
Why do we need hashset in java?
how to deploy tomcatserver to weblogic server? write d following steps?
Which is dependent variable?
Explain the difference between abstract class and interface in java?
What is finalize method?
What is the use of singleton class?
What is method overloading in java ?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
How do you declare an array in java?