previous | index | next

Instance Variables

Each instance of a class, or object, is characterized by the values of instance variables (also called attributes), that can change over time.

Instance variables give objects their state.

Instance variables for Oxford shirts could store:

Instance variables can be inherited from ancestor classes.

Example: Oxford shirts have a price, but so do Chinos, so the instance variable price is attached to the Item class.


previous | index | next