It is because
polymorphism applies to instance methods only.
If you see the reference type declared is of A so compiler binds this value at compile time.
If you comment the variable present in class A and try to do something like
It will give you a compiler error.
Hope this helps,