# throw

A statement that deliberately raises an exception object.

## What does **throw** do in C#?

**throw** — A statement that deliberately raises an exception object.

```csharp
class Reservation
{
    void Reserve(int seats)
    {
        if (seats < 1)
        {
            throw new ArgumentException("Seat count must be positive");
        }
    }
}
```

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

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

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