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

How many classes can any class inherit java?

0 Answers  


how cani read a command line argument?(usingfile object).

3 Answers  


What is an infinite loop in java? Explain with an example.

0 Answers  


how to prepare for IT Officers Interview in Banks

0 Answers   TATA, Tata Steel Limited,


When should the method invokelater() be used?

0 Answers  






Can we override private constructor in java?

0 Answers  


Explain different types of thread priorities ?

0 Answers  


How do you sort data in java?

0 Answers  


String class is defined under which package in java?

0 Answers  


What does s mean in regex?

0 Answers  


Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?

0 Answers   Akamai Technologies,


How do u pass data from one jsp to another jsp?

3 Answers   Fidelity,


Categories