Skip to Content Java Solaris Communities Partners My Sun Sun Store United States Worldwide

»  Spotlight Articles
»  Projects
»  Publications
»  People
»  Awards
»  Events
»  Downloads
»  Internships
»  Contrarian Minds
»  About Sun Labs

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 ]
Would you recommend this Sun site to a friend or colleague?
Contact About Sun News Employment Privacy Terms of Use Trademarks Copyright 1994-2008 Sun Microsystems, Inc.