Explain java finally block
2,537 views · Published 7 August 2012 · 8:03 · Indexed 17 October 2026
Channel: Interview DOT · 2012 · Science & Technology
Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. TOP TEN JAVA BOOKS http://www.interviewdot.com/books-download/technical/top-ten-java-books-buy-o... FREE Java Interview Book Download.All The Best. http://www.interviewdot.com/books-download/java-interview-books-free-download... http://www.interviewdot.com The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs. But finally is useful for more than just 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, even when no exceptions are anticipated. If the JVM exits while the try or catch code is being executed, then the finally block may not execute. Likewise, if the thread executing the try or catch code is interrupted or killed, the finally block may not execute even though the application as a whole continues.
More from this channel
-
7:19
java pass by value
-
3:19
java interview best books
-
4:29
what are the advantages of OOPL Java Interview
-
5:51
Top 4 Job Interview Tips How to prepare for Job interview
-
5:29
Top Job Interview TIPS What are your strengths How to answer
-
3:49
Top 16 Job Interview Questions Best Job Interview Questions
-
2:57
Core Java Interview Questions and Answers For Freshers II
-
2:42
what are different access modifiers core java interview questions and answers