Home Segments Top Top Previous Next

258: Mainline

Instances exhibit the instance variables of their class and all the public instance variables declared in that class's superclasses. Each Movie instance, for example, has its own copy of every instance variable declared in the Movie and Attraction classes.

Similarly, instances serve as targets for instance methods defined in their class and all the public instance methods defined in that class's superclasses. You can, for example, work on a Movie instance not only with instance methods defined in the Movie class, but also with those defined in the Attraction class.