In my IMHO , when you invoke a static method and the static method is overloaded , you invoke the version compatible with the type of the class who invoked( I think I am being clear ) . I other words . if you replace your code like this " this.doSomething(null,null); " , you are invoking the version that takes an object as C as a paremeter
I have made the following observations Its probably not complete:-
Let us assume methods are overloaded- say we have methods method(int), method(long), method(char), method(Object), method(String), method(Integer). If an anonymous primitive / object is passed the method invoked will be based on the anonymous primitive / object type. If the primitive / object was not anonymous the method invoked would be based on the primitive�s variable type or object�s reference type. If the argument is an anonymous null and there are multiple overloaded methods that take reference arguments the compiler will complain about the ambiguity since there are multiple overloaded methods that take reference arguments but there are two inheritence heirachies String->Object & Integer->Object. If however the methods were method(int), method(long), method(char), method(Object), method(String) and the argument is an anonymous null then since there are multiple overloaded methods that take reference arguments but there is only one inheritence heirachy it will take the highest type here -String.
If there is no corresponding methods an attempt for widening conversion or upcasting will be attempted as with polymorphism. Otherwise the binding is compile time binding and not dynamic binding as with polymorphism
Rototillers convert rich soil into dirt. Please note that this tiny ad is not a rototiller: