Hello,
The following class line //1 gives illegal forward reference error. But line //2 gives no error, How this is possible? line //2 also reference the variable indirectly. Pls explain to me.
Thanks, Raghu.K
public class MyClass
{
private static int x = y; //1
private static int x = getValue(); //2
private static int y = 5;
private static int getValue()
{return y;}
public static void main(
String args[])
{System.out.println(x);}
}