private variable
nounUK /ˈpraɪ.vət ˈveə.ri.ə.bəl/
US /ˈpraɪ.vət ˈver.i.ə.bəl/
A private variable is a secret box inside a computer program that only that program can open and use.
The programmer made the score a private variable so other parts of the game could not change it by accident.
RELATED WORDS
OTHER MEANINGS
2. In object-oriented programming, a data member that can only be accessed from within the class that declares it.
The class keeps its balance in a private variable and offers a method to read it.
3. A variable whose value is not shared with or visible to other modules or files.
Each module stores its settings in a private variable to avoid conflicts.
4. A local variable used only inside a single function or block.
The loop counter is a private variable that disappears when the function ends.