# private

An access modifier that lets a member be used only inside the class or struct that declares it.

## What is **private** in C#?

**private** — An access modifier that lets a member be used only inside the class or struct that declares it.

```csharp
class Account
{
    private int balance = 20;

    public int Balance()
    {
        return balance;   // allowed: inside Account
    }
}

// new Account().balance won't compile: balance is private
```

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

Updated: October 19, 2026

## In other subjects

- [private in Java](https://www.ask-codey.com/glossary/private)
- [Private in OOP](https://www.ask-codey.com/glossary/private-oop)

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