Polymorphism applies only to INSTANCE METHODS.
Reference type decides which class's instance variables are to be used.
Test x = new Test1();
x is of type Test(superclass) . So x.a refers to the instance variable in superclass(3)
If you change your code to
Test1 x = new Test1();
x.a refers to the instance variable in subclass Test1(8)
Sandhya Bhaskara<br />SCJP 1.4,SCWCD 1.4,SCBCD 1.3,SCJP 6