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

Multiple inheritance

  • Multiple parent slots yield multiple inheritance.

  • All parents are searched. Only one slot must match; otherwise it's an error.

Multiple inheritance

Note that traits oddball has more than one parent slot - in fact, it has four. Because any slot can be a parent, multiple inheritance is achieved through the use of multiple parents. When a message is sent and cannot be bound to a local slot, all parents are searched for a matching slot. If more than one slot is found with a matching name, an error results. It does not matter how many inheritance paths there are to the slot.

[ 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.