# protected

An access modifier that lets a member be used inside its own class and in classes that inherit from it.

## What is **protected** in C#?

**protected** — An access modifier that lets a member be used inside its own class and in classes that inherit from
it, but not from anywhere else.

```csharp
class Account
{
    protected decimal balance = 20m;
}

class SavingsAccount : Account
{
    public void AddInterest()
    {
        balance += balance * 0.02m;   // allowed: SavingsAccount inherits from Account
    }
}
```

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

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

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