SE450: Java: Extending Classes [10/41] ![]() ![]() ![]() |
All classes that are not declared final can be extended in Java
The implementation of all methods that are not declared final can be overridden
The initialization of an extended class has two phases:
The field initialization is done by the constructor (or initialization
block) of each class. The constructors are called up the chain. The
default super()
constructor is called by default. If it
is not implemented in the superclass, a compile error will result. Different
constructors may be called, ex. super(param1, param2)
, but the
call to the superclasses constructor must the the first statement in the
constructor