Method overrding passing null object
<p>I am unable to understand why this program prints <strong>String</strong></p>

<pre><code>class AA {

    void m1(Object o) {
        System.out.println("Object ");
    }

    void m1(String o) {
        System.out.println("String ");
    }
}

public class StringOrObject {

    public static void main(String[] args) {
        AA a = new AA();
        a.m1(null);
    }
}
</code></pre>

<p>Please help me to understand how this works to print Sting rather than Object</p>
