[Tutor] What is a "state variable"?
Emile van Sebille
emile at fenx.com
Thu Nov 11 22:22:25 CET 2010
On 11/11/2010 12:11 PM Richard D. Moores said...
> The term comes up in the 2nd section of
> <http://en.wikipedia.org/wiki/State_%28computer_science%29> didn't help.
> k = 23
> Is k then a state variable in that its state is 23? What sorts of
> variables are, and are not, state variables?
> The concept of a state variable seems central to Kent's article. If
> only I knew exactly what it was.
From the article,
"A class is a container for shared state, combined with functions
(methods) that operate on that state. By putting state variables into
member fields, they are accessible to all the methods of the class
without having to be passed as parameters."
So, by his own definition state variables are parameters.
More information about the Tutor