java Api provided try catch finally ,try catch(its ok) but why try finally and exception occured at try then how the flow is?



java Api provided try catch finally ,try catch(its ok) but why try finally and exception occured at ..

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 ?    25 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is methodological framework?

0 Answers  


If I only change the return type, does the method become overloaded?

0 Answers  


Marker interface means , interface which has no methods.Then what is the necessity of its usage.I read "it tells the compiler that it should be treated differently ". "It is used to store state of an object". But still am not clear.Please explain clearly.

2 Answers  


How do you convert string to int in java?

0 Answers  


What are generic methods?

0 Answers  






What is the list interface in java programming?

0 Answers  


Are there any tools available in java to create reports?

5 Answers  


how to one war file class to another war file class?

0 Answers  


What is the driver class?

0 Answers  


what is servlet enginee?

0 Answers   Covansys,


Difference between Application and Applet ?

4 Answers   Wipro,


Howmany number of objects we can store in an ArrayList. Is there any limit?

7 Answers   TCS,


Categories