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 the difference between a threads start() and run() methods? : Java thread
What is the difference between length and length() method in java?
What is a parameter in simple terms?
Explain the difference between arraylist and linkedlist in java?
What is the basic concept of java?
Is null a string or object in java?
What is the synchronized method modifier?
What is use of inner class in java?
What are different types of inner classes ?
Can we catch more than one exception in single catch block?
What is the covariant return type?
What are the restrictions imposed on method overriding?
What are the actions that can occur when a thread enters blocked state?
What is the point of java?
What are the pillars of java?