Originally Posted by
Junky
You are correct that constructors are not inherited. However, each constructor calls the super constructor all the way upto Object class (which doesn't call super as it is the top level class). If you do not insert a call to the super class constructor then the compiler will insert one implicitly. Therefore the constructor in the ChoclateChip class is actually:
public ChocolateChip() {
super();
System.out.println("ChocolateChip constructor");
}
Hi Junky,
I didn't realize that the compiler can insert super() implicitly.
Many thanks for your clarification and quick reply!