class A { }
class B extends A { }
class C extends B {
static void doSomething ( A x , A y ) {System.out.print("AA");}
static void doSomething ( A x , B y ) {System.out.print("AB");}
static void doSomething ( B x , A y ) {System.out.print("BA");}
static void doSomething ( B x , B y ) {System.out.print("BB");}
static void doSomething ( C x , C y ) { System.out.println("CC");}
public static void main(
String[] args) {
doSomething(null,null);
}
}
Output is CC;
Why it calls "static void doSomething ( C x , C y ) " eventhough other methods also can accpet the null argument???