Skip to content

containmentExample

An example of containment. An adventure game has an instance of the Person class. The Person class has a collection of Item instances.

An example of containment. An adventure game has an instance of the Person class and a collection of instances of the Location class. The Person and Location classes have a collection of Item instances.