Java · Inheritance, polymorphism and interfaces

What the declared type allows, and casting

The object decides which version runs, but the compiler only knows the variable's type, and that decides what you may call.