What is method hiding in Java? Even the JavaDoc explanation is confusing

Here, Cat.foo() is said to hide Animal.foo(). Hiding does not work like overriding, because static methods are not polymorphic. So the following will happen: Calling static methods on instances rather than classes is a very bad practice, and should never be done. Compare this with instance methods, which are polymorphic and are thus overridden. The … Read more