java Api provided try catch finally ,try catch(its ok) but why try finally and exception occured at try then how the flow is?
Answer / vandana singh
If you want to do a task that must be perform with every situation when exception occurs or not. that you should write the code for this in finally block. cause finally block execute in both situation exception occurs or not.
if an exception occurs then catch block statements execute after that control transfer to finally block.
if any exception not occurs than control transfer to finally block.
| Is This Answer Correct ? | 26 Yes | 0 No |
Is constructor inherited?
what is private constructor?what are the uses of writing private constructor in our program?
How many decimal places is a double?
What does system.gc() and runtime.gc() methods do?
What do you understand by looping in java? Explain the different types of loops.
Does collectionutils isempty check for null?
How to validate the request (Eg:user name and password) in session(http session)? not in LDAP server ?
String Reverse in Java...!
Which programming language is most secure?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
Where can I find jdk in my computer?
Can you extend singleton class?