J.7. Class Account

Class Account (Fig. J.6) represents a bank account. Each Account has four attributes (modeled in Fig. 11.20)—accountNumber, pin, availableBalance and totalBalance. Lines 4–7 implement these attributes as Private instance variables. Note that when we provide a property to access an instance variable, we create the instance variable name by appending Value to the end of the attribute name that was listed in the model. We provide a property with the same name as the attribute name (but starting with a capital letter) to access the instance variable. For example, property AccountNumber corresponds to the accountNumber attribute modeled in Fig. 11.20. Since clients of this class do not need to modify the accountNumberValue instance ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.