Hi,
On page 94, K&B, this line:
The methods you can call on a reference are totally dependent on the declared type of the variable, no matter what the actual object is, that the reference is referring to.
Then on page 102, we have this:
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 an interface), but at runtime the ONLY things that are dynamically selected based on the actual object (not reference type) are instance methods
These lines really confuse me all the time. i am unable to understand them when I read both of them side-by-side, they almost seem like contradicting each other (I know they are not, I am trying to understand why).
Please help!
- aditya