Why we need Finally with try?
pls expain with ur example..

Answer Posted / uppaluri

Finally Block always executes when the try block exists. Finally is used for more than exception handling : It allows the Programmer to avoid having cleanup code accidentally bypassed by a return, continue, or break. Putting cleanup code in a finally block is always a good practice. Hopefully you find your Solution.If you have any questions regarding Java mail me

Is This Answer Correct ?    16 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between state-based unit testing and interaction-based unit testing?

726


What is the output of the below java program?

824


What are the drawbacks of singleton class?

786


How are java objects passed to a method and what are native methods?

833


what is mena by object block any what is the use of that

1988


Is it possible for yielded thread to get chance for its execution again ?

784


Is java a digit method?

753


I don’t want my class to be inherited by any other class. What should I do?

801


Write a program to print 15 random numbers using foreach of java 8?

751


How many types of interfaces are there?

781


Why are parameters used in functions?

728


How to reverse a string in java?

779


How to invoke external process in java.

787


What are variable arguments or varargs?

796


Which collection is ordered in java?

748