# finally Block

A block that normally runs after try and catch whether an exception occurred or not.

## What is **finally Block** in C#?

**finally Block** — A block that normally runs after try and catch whether an exception occurred or not.

```csharp
class OrderReader
{
    int ReadQuantity(string text)
    {
        try
        {
            return int.Parse(text);
        }
        catch (FormatException)
        {
            return 0;
        }
    }
}
```

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/journeyman)

Updated: September 27, 2026

## In other subjects

- [finally Block in Java](https://www.ask-codey.com/glossary/finally-block)
- [finally Block in JavaScript](https://www.ask-codey.com/glossary/finally-block-javascript)

Source: https://www.ask-codey.com/glossary/finally-block-c-sharp
