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
Why array is used in java?
What is another word for methodology?
Is string a wrapper class?
Write a program to print 15 random numbers using foreach of java 8?
How do you create a bulleted list?
Difference between static and dynamic class loading.
What is tochararray in java?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
Why for each loop is used?
Why generics are used in java?
Why singleton class is used in java?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
How to reverse a string in java?
Which method must be implemented by all threads?
Differentiate between static and non-static methods in java.