
10.2 Inheritance Design 663
10.2.2 Subclass Constructors
Although constructors are public, they are not inherited by subclasses. How-
ever, to initialize the private instance variables of the superclass, a subclass con-
structor can call a superclass constructor either implicitly or explicitly.
When a class extends another class, the default constructor of the subclass
automatically calls the default constructor of the superclass. This is called
implicit invocation. Athough we did not code any constructors in our
CheckingAccount class in Example 10.2, we were able to instantiate a
CheckingAccount object (with a 0.0 balance) because the Java compiler ...