Hi I need an explanation. Let's look at the code below before the question is to be asked.
i know that
Polymorphic method invocations apply only to instance methods. You can always refer to an object with a more general reference variable type (a superclass or interface), but at runtime, the ONLY things that are dynamically selected based on the actual object (rather than the reference type) are instance methods. Not static methods. Not variables. Only overridden instance methods are dynamically invoked based on the real object's type.
problem is I don't get it. question is why can't variable be called when it comes to
I thought it'd make sense to do so. Could anyone give me an explanation to this.