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 purpose of the main method?
Can a static method be overridden in java?
What are triggers in DB? Explain their types. How do they work?
When do we need to use internal iteration? When do we need to use external iteration?
how to one war file class to another war file class?
How many types of java are there?
What is the use of isempty in java?
What is command line used for?
Can we have more than one package statement in the source file?
What are parsers? Dom vs sax parser.
Why are arrays useful in java?
How are the elements of a gridbaglayout organized?
What is a line break example?
Can a main method be overloaded?
who can i handle multiple client in RMI