Why we need Finally with try?
pls expain with ur example..
Answer Posted / neha
finally block gets executed in both scenarios I.e exception occurs or doesn't occur..it is used to write the code which we want to execute in both successful or failed scenarios..generally code for cleaning up resources added in finally block.e.g closing file,closing socket connection.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What do you mean by access modifier?
Compare overloading and overriding?
What is the formula to calculate percentage?
Does java list allow null?
Why are there no global variables in java?
What is the difference between a break statement and a continue statement?
what is meant by encapsulation?
Which is better list or arraylist in java?
What is meant by oops concept in java?
Which list does not allow duplicates in java?
What is difference between word and integer?
What is vector?
Write a code to create a trigger to call a stored procedure
Difference between final and effectively final ?
How transient variable is different from volatile variable?