Home Segments Top Top Previous Next

260: Mainline

In general, the first step taken by any constructor in any class, other than the Object class, is to call the zero-parameter constructor in the direct superclass.

Thus, when you create an instance, all the zero-parameter constructors in the instance's superclasses are called automatically, and each has the opportunity to contribute to the values of the instance variables associated with the new instance.

In Chapter 17, you learn how to arrange for a constructor to call a constructor other than the zero-parameter constructor.