Home Segments Top Top Previous Next

294: Mainline

Ordinarily, the first action of a constructor is to call the zero-parameter constructor in the direct superclass. Thus, both of the constructors in the Movie class, as now defined, call the zero-parameter constructor in the Attraction class:

*------------------* 
| Attraction:      | 
|                  | 
| constructors:    | 
|  zero parameter <---*-* 
|                  |  | | 
*------------------*  | | 
  ^                   | | 
  | extends           | | 
*------------------*  | | 
| Movie:           |  | | 
|                  |  | | 
| constructors:    |  | | 
|  three parameter ---* | 
|  four parameter  -----* 
|                  | 
*------------------*