In this case, you are not trying to use the value of x, you are simply assigning a value to x.
In this code
code:
x = 10;
static int x = 15;
this doesn't have anything to do with forward referencing. The variable x is not known until you declare it.(since x is static(second line) ,and in the first line we declared x is a instance variable.so that instance variable x type is not declared yet error is coming.)i got it.
like that way,i gave
i1=1;
int i1=5;//note not a static variable.
inside the inner class.But this is giving compile error.
I thought i am not trying to use the value of i1,i am just simply assigning a value to i1 on the first line.so this is not violation forward reference rule.so this won't give compile error.But this is giving compile error.
program for verification.
Am i making any sense with my question?
[ February 13, 2007: Message edited by: Shiva Mohan ]
[ February 13, 2007: Message edited by: Shiva Mohan ]