# protected

An access modifier that permits package access and access through subclasses.

## What is **protected** in Java?

**protected** — An access modifier that permits package access and access through subclasses.

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

    public int balance() {
        return balance;
    }
}
```

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

Updated: September 27, 2026

## In other subjects

- [protected in C#](https://www.ask-codey.com/glossary/protected-c-sharp)
- [Protected in OOP](https://www.ask-codey.com/glossary/protected-oop)

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