How is a constructor executed?
Posted
by simion
on Stack Overflow
See other posts from Stack Overflow
or by simion
Published on 2010-06-01T10:13:15Z
Indexed on
2010/06/01
10:13 UTC
Read the original article
Hit count: 156
I am doing some reviison from the lecture slides and it says a constructor is executed in the following way;
If the constructor starts with this, recursively execute the indicated constructor, then go to step 4.
Invoke the explicitly or implicitly indicated superclass constructor (unless this class is java.lang.Object)
Initialise the fields of the object in the order in which they were declared in this class
Execute the rest of the body of this constructor.
What i dont undertsand is that, a constructor can never "start" with this, because even if it forms no class heirarchy/relationship then super() is inserted by default.
How would this fit in with the description above?
Thanks
© Stack Overflow or respective owner