Suppose that I have these classes:
class A {}
class B extends A {}
Also
static void call(A a) { System.out.print("A"); }
static void call(B b) { System.out.print("B"); }
public static void main(String[] args) {
A a = new A();
A b = new B();
call(a);
call(b);
}
What I am getting as output is: AA
while I was expecting: AB
I am wondering why?