Java Reference
In-Depth Information
}
}
If you create an object of type Y and follow the construction step by
step, here are the values of the fields after each step:
Step What Happens
xMask yMask fullMask
0
Fields set to default values
0
0
0
1 Y constructor invoked
0
0
0
2 X constructor invoked ( super )
0
0
0
3 Object constructor invoked
0
0
0
4 X field initialization
0x00ff0
0
5 X constructor executed
0x00ff0
0x00ff
6 Y field initialization
0x00ff0xff000x00ff
7 Y constructor executed
0x00ff0xff000xffff
Understanding this ordering is important when you invoke methods dur-
ing construction. When you invoke a method, you always get the imple-
 
Search WWH ::




Custom Search