try
{
//code
}
catch
{
//code
}
finally
{
//code
}
Why to use "finally" block in c#?
Asked
5 years ago
Viewed
770 times
Why to use "finally" block in c#?
1 Answer
Finally keyword is a reserved keyword in C#.Finally block executes when the try/catch block leaves the execution, no matter what condition caused it. It always executes whether the try block executes normally or without any exception.The main purpose of finally block is to release the system resources.