No content available!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, the
finallyblock is executed however the flow leaves thetryblock – whether by reaching the end, returning, or throwing an exception.From the C# 4 spec, section 8.10:
(Section 8.10 has a lot more detail on this, of course.)
Note that the return value is determined before the finally block is executed though, so if you did this:
… the value 4 will still be returned, not 1 – the assignment in the
finallyblock will have no effect.