posted 16 years ago
Hi Friends,
I have gone through a statement saying "declare before you read".
I have the following lines of code:
case 1:
int j = i;//compile time error.
int i;
case 2:
int j = this.i;//compiles fine
int i;
case 3:
int j = i = 20;//compiles fine.
int i;
I have the following questions:
Q 1:
While accessing the instance variables the compiler will append this keyword before the variable. Is my assumption correct.
Q 2:
Can any one explain why the compiler does not throw any error in case 3 even if we are not using this keyword before the variable?
Thanks,
Ravindra.