State

noun

say it: “STAYT” /steɪt/

The values an object holds at a given moment.

What is State?

An object's state is the current values of its data. A light switch object might be in the "on" state or the "off" state. Calling methods usually changes the state.

var lamp = new Lamp();  // IsOn = false
lamp.TurnOn();          // IsOn = true: the state changed

In a sentence

  • “After the touchdown, the scoreboard's state was Home 14, Away 7.”

Level: Novice · More OOP terms at this level

Updated