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
Can a abstract class be declared final?
Which keyword specify that a variable is effectively final ?
In a class implementing an interface, can we change the value of any variable defined in the interface?
how to deploy tomcatserver to weblogic server? write d following steps?
What is tcp ip in java?
What is an enumeration?
Should a main method be compulsorily declared in all java classes?
What is map java?
Write a java program for binary search?
What is the byte order of byte buffer?
Explain different types of thread priorities ?
Is string is a class in java?
What is unmodifiable list in java?
Does substring start with 0?
How many bits is a string?