Specialization, Extension, and Inheritance
- slide 25 : 40
Constructors and initialization order
The instance variables of a newly allocated object are initialized in a particular order
Initialization of a C-object:
new C(...)
Instance variables in
C
are initialized (field initializers)
Instance variables in superclasses are initialized - most specialized first
Constructors of the superclasses are executed - most general first
The constructor body of
C
is executed