Does polymorphism apply on class attributes in Java?

When you extend a class, methods are overriden, but fields are hidden. Dynamic dispatch works for methods, but not for fields. Why is the language designed so, god knows why.

Leave a Comment