Can I write a return statement in the catch clause,which is followed by a finally block?Will the code compile?How is the code executed?

Showing Answers 1 - 2 of 2 Answers

Yes we can write a return statement in a catch followed by finally.The code will compile and run. If we have a statment like return 0 in catch block and return 1 in the finally block then 1 will be returned to the calling method.Otherwise, 0 will be returned.

  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