created: 12/30/98; revised: 09/26/99, 01/21/00, 07/14/02, 01/19/06
The state of an object is the data it is currently holding.
An object stores its state in its instance variables.
For example, the state of a
object is the value of the three variables
Instance variables hold their values until they are explicitly
changed or until the object is destroyed.
An object's methods frequently work with values that are not part of an object's state. These values are held in the local variables and parameters of methods. This chapter discusses how these are declared and used.
(Review:) What is a parameter of a method?