Header Ads

  • Breaking Now

    What can prevent the execution of the code in finally block?

    -Use of System.exit()
    -The death of thread
    -Turning off the power to CPU
    -An exception arising in the finally block itself

    2 comments:

    1. Or a return statement in the try or catch block.

      ReplyDelete
    2. Even if return is there in Try or Catch, the finally will still be executed...

      ReplyDelete

    Post Top Ad

    Post Bottom Ad