Are you better than me? Then please show me my mistakes..
Supun Lakshan Dissanayake wrote:I need to know why constructor method of class B runs first of all.
...when we load a java template to RAM...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:What do you think:
new B();
asks the JVM to do?
Are you better than me? Then please show me my mistakes..
Supun Lakshan Dissanayake wrote:How JVM execute constructor method of super class before executing constructor method of sub class ?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Steve
Supun Lakshan Dissanayake wrote:
Winston Gutkowski wrote:What do you think:
new B();
asks the JVM to do?
I think static initializer and object initializer perform their tasks to following order
01. initialize static variable(s) of super class
02. execute static block(s) of super class
03. initialize static variable(s) of sub class
04. execute static block(s) of sub class
05. initialize instance(non-static) variable(s) of super class
06. execute instance block(s) of super class
07. execute constructor method of super class
08. initialize instance(non-static) variable(s) of sub class
09. execute instance block(s) of sub class
10. execute constructor method of sub class
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |