Stop Finally statement

How can we stop finally method to execute?

Questions by usmita

Showing Answers 1 - 1 of 1 Answers

banduskank

  • Jun 30th, 2008
 

you can put System.exit(1) in try block to terminate the bolck. this will prevent excuting finally statement.

eg

try {
               // you code
              System.exit(1);
 } catch (Exception e)
{
      // handle exception
} finally
{
      // your code
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions