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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between an object-oriented programming language and object-based programming language?

547


Is arraylist zero based?

559


How many bits is a string?

525


What does singleton class mean?

535


What is a linkedhashmap java?

552






What is method in research paper?

574


Which method must be implemented by all threads?

721


What does || mean in code?

545


What state does a thread enter when it terminates its processing in java programming?

578


Explain about the interpreter in java?

625


What is an object’s lock and which object’s have locks?

506


What does s mean in regex?

553


Explain the difference between transient and volatile in java?

578


Does a class inherit the constructors of its superclass in java programming?

529


How big is a gigabyte?

617