The compiler allows the following program:
class Foo {
int foo;
Foo() {
this(this, f());
}
Foo(Foo f, int i) {
}
int f() {
return foo;
}
}
Note how it references "this", and "this.f()" before the constructor is called.
class Foo {
int foo;
Foo() {
this(this, f());
}
Foo(Foo f, int i) {
}
int f() {
return foo;
}
}
Note how it references "this", and "this.f()" before the constructor is called.