Hi,
I am not getting why i am not able to access parent class instance variable outside the child class intance methods.
class Parent
{
int a;
}
class Child extends Parent
{
a = 1; // Here i am getting a compilation error that Syntax error on token "a", VariableDeclaratorId expected after this token
void someMethod()
{
a = 1; // Here i am not getting any compilation error while accessing parent class variable
}
}
Can any one please let me know exact reason for this and what is the error talks about?
Thanks,
Uday
Edited by: Udaya Shankara Gandhi on Jun 13, 2012 3:30 AM