My understanding is that non-static fields are given default values before the object is instantiated, whether or not they are later given non-default initialization values when it is instantiated (Mughal/Rasmussen p. 342). Does this happen when the class is loaded, along with static members, or when the *new* operator is called on a class's constructor and before the constructor is actually run? Or . . . The problem I'm having is understanding why it is that, during initialization of an object, a field can be written to before it's declared, but can't be read before it's declared. If an int can have its default zero overwritten before the thread of execution reaches its declaration/initialization, why can't it be read? (I can't think of any reason why you'd ever want to, I just want to know how this works.) M/R provide this example (p. 333):
At the line labeled (3), how can there be a 'this'? The object is in the middle of being constructed. If it means *'this' so far*, or *this such as it is at (3)*, then why is this.width readable and width, as in line (2), not readable? There's something in this whole scenario I'm missing, that would probably answer all these questions. Thanks in advance. Dennis ps - this is my first visit to the ranch. This is probably one of Java's best kept secrets (not that it should be).