Local Variable

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.

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

Level: Apprentice · More Java terms at this level

Updated

In other subjects