Originally posted by Clement Ng:
Hi,
Order of code execution
1.static variables initialization.
2.static initializer block execution. (in the order of declaration, if multiple blocks found)
3.constructor header ( super or this – implicit or explicit )
4.instance variables initialization / instance initializer block(s) execution
5.rest of the code in the constructor
Interfaces
Clement
This order of execution is really helpful, I actually copy it down.
But I have a question related to this. Is this statement true or false: "The default constructor initializes the instance variables declared in the class. " Looks like instance variables intitialized at the time constructor is executed(between step 3 and 5), but is it OK to say constructor initializes the instance variables??