# Local Variable

say it: **“LOH-kul VAIR-ee-uh-bul”** **/ˈloʊkəl ˈvɛəriəbəl/**

A variable declared inside a method or block and usable only there.

## What is **Local Variable** in Java?

**Local Variable** — A variable declared inside a method or block and usable only there.

```java
class Game {
    void updateScore() {
        int score = 10;
        score = score + 5;
    }
}
```

Level: Apprentice · [More Java terms at this level](https://www.ask-codey.com/glossary?category=java&level=2)

Updated: November 17, 2026

## In other subjects

- [Local Variable in C#](https://www.ask-codey.com/glossary/local-variable-c-sharp)
- [Local Variable in Python](https://www.ask-codey.com/glossary/local-variable)
- [Local Variable in Unix](https://www.ask-codey.com/glossary/local-variable-unix)

Source: https://www.ask-codey.com/glossary/local-variable-java
