# Setter

*noun*

say it: **“SET-er”** **/ˈsɛtər/**

The set part of a property, which runs when code stores a new value and can check it first.

## What is **Setter** in C#?

**Setter** — A method that validates or changes an object's stored value.

```csharp
class Thermostat
{
    public int Temperature
    {
        get;
        set;
    }
}
```

## In a sentence

- “The **setter** for Price throws an error 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

- [Setter in Java](https://www.ask-codey.com/glossary/setter)
- [Setter in JavaScript](https://www.ask-codey.com/glossary/setter-javascript)
- [Setter in OOP](https://www.ask-codey.com/glossary/setter-oop)

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