D
Dave Rush
Hi y'all,
So after spending a particularly frustrating afternoon debugging
through constructors and browsing the Java Language Specification 3.0
in some detail, I have come to the conclusion that I actually know
nothing and need to ask a question:
What is the standard order of evaluation of expressions during object
construction w/rt constructors, super-constructors, and instance
variable initializers? Specifically with the code:
class A
{
AType a1 = new AType();
A() { aDoesSomething(); }
}
class B extends A
{
AnotherType b1 = new AnotherType();
B() { bDoesSomethingElse(); }
}
B bongo = new B();
when do all of the various bits get executed? If there's a section of
the language spec that tells me this, I would really appreciate the
pointer, as well...
david rush
So after spending a particularly frustrating afternoon debugging
through constructors and browsing the Java Language Specification 3.0
in some detail, I have come to the conclusion that I actually know
nothing and need to ask a question:
What is the standard order of evaluation of expressions during object
construction w/rt constructors, super-constructors, and instance
variable initializers? Specifically with the code:
class A
{
AType a1 = new AType();
A() { aDoesSomething(); }
}
class B extends A
{
AnotherType b1 = new AnotherType();
B() { bDoesSomethingElse(); }
}
B bongo = new B();
when do all of the various bits get executed? If there's a section of
the language spec that tells me this, I would really appreciate the
pointer, as well...
david rush