# throw

*noun*

say it: **“THROH”** **/θroʊ/**

The C# statement that raises an exception on purpose, such as when a value isn't allowed.

## 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");
        }
    }
}
```

## In a sentence

- “The Price setter uses **throw** for a negative price.”

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=3)

Updated: November 9, 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)
- [throw in PowerShell](https://www.ask-codey.com/glossary/throw-powershell)

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