In this java interview short , we will discuss about finally block in java and to be specific , we will discuss when the java finally block doesn't gets invoked. Well , in java we can write a finally block with a try block or with a try and catch block for exception handling. the finally block guarantee that our code inside the block will be executed.
but if we try to exit our application with System.exit or Java Runtime class halt method, the finally block doesn't execute.let's see this in detail.
So let's learn finally block in java and when finally block is not executed : One of the top rated question in exception handling.
#javaprogramming #javainterviewquestionsanswers #javashorts