OUTPUT:B
Why does virtual machine call this method f(null){System.out.println("B");}?
Why not f(null){System.out.println("A");}
public class Test{
    public static class A {}
    public static class B extends A {}
    public void f(A a) {System.out.println("A");}
    public void f(B a) {System.out.println("B");}
    public static void main(String[] args) {
        new Test().f(null);
    }
}
 
     
    