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 |
I need help please send me reply: Write a program "if given a string like 'HAT', the combination's returned should be like ATH,THA,TAH in java"?
What is return null in java?
How to compare two strings in java program?
What is class and its types?
What is AppletStub?
What is the use of keywords in java?
Is intellij better than eclipse?
How does split work in java?
What is the largest data type in java?
How we can execute any code even before main method?
What's the purpose of static methods and static variables?
Why do we declare a class static?