Notice that this hierarchy of containment (Room contains an Item which contains another Item) is completely different than the inheritance hierarchy. A kitchen may contain a box, and a box may contain a knife, but that does not mean that a knife is a kind of box. The concept of "hierarchy" is a useful concept, but it appears in several different contexts. Don't confuse an inheritance hierarchy (where one thing is an extension of another) with a containment hierarchy (where one thing is contained in another).
You may go to the next section.
You may also:
|Go back to the question||Go up to the outline of lesson 18|
David A. Wheeler (email@example.com)
The master copy of this file is at
The master copy of this file is at "http://www.adahome.com/Tutorials/Lovelace/s18s4r1.htm".