|
|
Instance Variables | The individual state of objects are contained in instance variables.
We illustrate instance variables by the owner, balance and interest rate of bank accounts.
The exercise at the bottom of this page explores the visibility of the private instance across two or more
instances of class BankAccount. |
|
Three objects of class BankAccount, each holding three instance variables interestRate, owner, and balance. The values of variables are determined by the bank account transactions that we programmed
in the class BankAccountClient. The state of the variables is shown relative to the three WriteLine calls. |
|
Read more about instance variables in the text book version of this material. |