Why does the compiler match the String
overload, and not the Object
overload?
public static void main(String[] args) {
method(null);
}
public static void method(Object o) {
System.out.println("Object impl");
}
public static void method(String s) {
System.out.println("String impl");
}