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 |
Are generics important java?
How many threads can I run java?
How do you calculate roots in java?
where singleton classes are used in j2ee web application.can we use it for connection pooling.
What is final method?
if i have one string class then how can you achive this class functionality of this class?
What is the use of set in java?
What is difference between adapter class and listener?
What about abstract classes in java?
Which method cannot be overridden in java?
which class is the wait() method defined in? : Java thread
what is the purpose of using rmisecuritymanager in rmi?