Exeption Handling

What happenes if exception occur in finally block?

Questions by sandhyatammala

Showing Answers 1 - 6 of 6 Answers

finally is like any other block or method , but this will be executed untill and unless your JVM is shutdown  if an exception occurs in finally blcok and if u dont catch it program will terminate.

  Was this answer useful?  Yes

fcasttro

  • Mar 23rd, 2007
 

  Finally is just a method,  if an exception occurs in finally block the program will terminate. So, U just put a try - catch block inside the finally block. Are explicity you have to catch the exception.

finally {
               try{}
                catch(Exception ex){}
          }

  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