# Encapsulation

*noun*

say it: **“en-kap-syuh-LAY-shun”** **/ɪnˌkæpsjəˈleɪʃən/**

Keeping an object's data private and letting other code read or change it only through its methods and properties.

## What is **Encapsulation** in C#?

**Encapsulation** — Keeping an object's data behind methods that control how it is read or changed.

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

## In a sentence

- “Thanks to **encapsulation**, nobody can set a team's wins to -3; the property refuses it.”

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

- [Encapsulation in Java](https://www.ask-codey.com/glossary/encapsulation-java)
- [Encapsulation in JavaScript](https://www.ask-codey.com/glossary/encapsulation-javascript)
- [Encapsulation in OOP](https://www.ask-codey.com/glossary/encapsulation-oop)
- [Encapsulation in Python](https://www.ask-codey.com/glossary/encapsulation)

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