That is not polymorphism, but you are right. You can only call the methods which are in A.
Joined: Nov 28, 2012
So there is a downside of having a superclass reference to your subclass object. You can call only the inherited methods and not your own specific methods. Right?
Joined: Oct 13, 2005
Now how on earth is the compiler to tell whether it can call the fizz method or the buzz method? It is impossible to tell what the runtime type of sup will be in advance.
You are right: you can only call methods which are declared in the type of the reference. The reference type might be abstract or an interface, in which case the methods might be abstract in the reference type, but must be implemented in the runtime types.