Hi
Key
word here is "most-specific".
Scenario 1:
------------
Suppose we have a Class B which extends Class A :
Object <-- Class A <-- Class B
So here we have above hierarchy.
Suppose now we have three methods:
public void method(Object o);
public void method(A a);
public void method(B b);
and if we call
method(null) then it will most specific method i.e method having B as parameter
Scenario 2:
-----------
Suppose we have two independent classes A and B :
Object <-- A
Object <-- B
Suppose now we have three methods:
public void method(Object o);
public void method(A a);
public void method(B b);
and if we call
method(null) then it will have two most specific methods i.e method having A as parameter and method having B as parameter and hence will give compilation error.
I hope this is clear to you.
Murali...