posted 12 years ago
Since you are calling a constructor of a class using super() or this(), you don't have an object of that class yet.. So, you don't have access to instance variables or methods of that class. So, while instantiating a class using super() or this(), you have access only to their static members since they are loaded when jvm loads the class.
For eg:
class sample
{
static int a=10;
int b=11;
sample(int x)
{
//Something
}
sample()
{
this(a); Is Correct !
this(b); Is Incorrect ! (Both inserted individually)
}
}