Forward referencing is allowed during declarations when the undeclared variable is used in the LHS of an expression, but not if its in the RHS. Therefore, the following won't work :
class A
{
int a=h;
int h;
}
But the following code works :
class A
{
int a=this.h;
int h;
}
This will assign 0 to a as 0 is the default value of ints. Why did this work ? this refers to the present object, and it is being currently constructed. Why does the use of this make any difference ?