posted 11 years ago
Hi Alex,
Since you are calling a OVERLOADED method, compiler will look for the reference type only and not the instance type.
You are invoking the method f using class A's reference variable. And A knows only f(A a). At runtime you can pass a covariant i.e, you can pass B's instance to f(A a).
y1.f(y2) will invoke A's f(A,a) method. Hence you are getting false obviously.