Using inherited methods

Sending deposit: or withdraw: uses the original methods, which still work, despite changing balance and balance: to methods.

Using the methods inherited from the bank account traits

We can now also try depositing and withdrawing funds from the stock account.

We will be using the deposit: and withdraw: methods from the bank account traits, as we have not altered the stock account's parent.

Note that although these methods were created when the balance and balance: messages accessed and set a data slot, they still do the right thing because we have provided suitable implementations in the child.

[ Previous ] [ Index ] [ Next ]