Categories

Oct 18, 2019 in C Sharp (C#)
Q: Why to use “finally” block in C#?

1 Answer

Oct 18, 2019

“Finally” block will be executed irrespective of exception. So while executing the code in try block when exception is occurred, control is returned to catch block and at last “finally” block will be executed. So closing connection to database / releasing the file handlers can be kept in “finally” block.

Click here to read more about C Sharp
Click here to read more about Insurance

Related questions

Madanswer
Mar 5 in C Sharp (C#)
Oct 18, 2019 in C Sharp (C#)
Oct 18, 2019 in C Sharp (C#)
...