Polymorphism, variable shadowing/hiding

Let's say if superclass and subclass have one instance field named the same - var. Then casting the object will change the result. "((Superclass) subclassObj).var" gives the Superclass's instance field var. So I suppose variable names in Java are resolved by the reference type, not the actual obj type they are referencing. while method names are dynamic binding, which uses the actual obj type. So it comes the polymorphism