encapsulated variable
nounA variable that is kept safe inside a little box so only certain parts of a program can see or change it.
The encapsulated variable can only be changed by calling the class's own method.
RELATED WORDS
OTHER MEANINGS
2. A variable bundled together with the methods that operate on it inside an object.
In object-oriented design, an encapsulated variable belongs to the object and is accessed through its interface.
3. A data field whose direct access is restricted to prevent accidental outside changes.
By making the balance an encapsulated variable, the bank program stops other code from setting it to a wrong value.
4. A variable hidden behind a public function so its internal details stay private.
The encapsulated variable stores the player's score, and only the updateScore function can modify it.