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 |
What is the purpose of java?
What is string in java?
What is the purpose of the return statement?
What is the difference between access specifiers and access modifiers in java? 16
Does unicode support all languages?
What are checked exceptions?
What’s a deadlock?
What are classloaders?
What are the differences between include directive and include action?
how can u apply shallow cloning and deep cloning to create object?
Why string is called as immutable?
What's a method in programming?