Buy GNU books!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Our second subclass of Account represents a checking account. We will keep track of two facets:
We will define this as another subclass of Account:
Account subclass: #Checking instanceVariableNames: 'checknum checksleft' classVariableNames: '' poolDictionaries: '' category: nil !
We have two instance variables, but we really only need to
initialize one of them--if there are no checks left, the current
check number can't matter. Remember, our parent class
Account will send us the
init message. We don't need our
new function, since our parent's will
provide everything we need.
!Checking methodsFor: 'Initialization'! init checksleft := 0. ^super init ! !
As in Savings, we inherit most of abilities from our superclass,
Account. For initialization, we leave
alone, but set the number of checks in our checkbook to
zero. We finish by letting our parent class do its own
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|