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
What is a for loop in java?
What are constructors in java?
How will you load a specific locale?
Which oo concept is achieved by using overloading and overriding?
How do you use compareto?
How do you delete a list in java?
Explain the difference between static and dynamic binding in java?
What about interrupt() method of thread class ?
What is static method with example?
What is the difference between a synchronized method and a synchronized block?
What is the use of set in java?
What is object in java?
What is the primitive type short?
How to check if a list is sorted in java?
Can you pass by reference in java?