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");}//line 4
public static void main(String[] args) {
doSomething(null,null);
}
}
The above code prints "CC" as the o/p.If we comment out line 4 then it prints "BB". I m confused,
as why does not it takes the other two values or print "BB" from first?
Please help..