posted 21 years ago
1) When the class is loaded the static fields receive their default values (0 , 0.0 , null)
2) The class is initialized, typically, when the first instance is created, or the first access to one of its static members occurs. Then the static initializers and the static block initializers are executed in textual order.
3) Each time an instance of the class is created:
3.1) its instance fields receive their default values.
3.2) a chain of this(...) super(...) constructors calls end up into the constructor of the class Object.
4) For each constructor in the chain, from Object to the constructor of the class being instantiated, the sequence of execution is like this:
4.1) instance initializers and block instance initializers in textual order.
4.2) the code placed in the constructor by the programmer.
[ November 15, 2002: Message edited by: Jose Botella ]
[ November 15, 2002: Message edited by: Jose Botella ]
SCJP2. Please Indent your code using UBB Code