# private

An access modifier that limits a member to its declaring top-level class.

## What is **private** in Java?

**private** — An access modifier that limits a member to its declaring top-level class.

```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

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

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