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 Posted / 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 |
Post New Answer View All Answers
What is difference between calling start() and run() method of thread?
Name and explain the types of ways which are used to pass arguments in any function in java.
Explain Basics of OOP Language in java
What do you understand by soft reference?
Write an algorithm for quick sort?
How does predicate work in java?
Is it possible to use string in the switch case?
How is tree Mirroring implemented?
Can a class extend 2 classes in java?
Is logger a singleton?
What is codebase?
What about interthread communication and how it takes place in java?
What is array initialization in java?
What purpose do the keywords final, finally, and finalize fulfill?
What is object-oriented paradigm?