The type of the object created with a help of Object o = "";
<p>Say, there is a following example:</p>

<pre><code>class Super {
    public int i = 3;
    public void m(Object o) {
        System.out.println("Object  " + i);
    }
    public void m(String o) {
        System.out.println("String  " + i);
    }
}

public class Sub extends Super {
    public Sub() {
        i = 5;
    }
    public static void main(String[] args) {
        Super s = new Sub();
        Object o = "";
        s.m(o);
        s.m("");
    }
}
</code></pre>

<p>The result of this code is:</p>

<pre><code>Object 5
String 5
</code></pre>

<p>But I thought it would be:</p>

<pre><code>String 5
String 5
</code></pre>

<p>Don't quotes set String as this object's type? There are definitely some cases of casting to String with a help of quotes, so I'm a little confused about this basic example. Thanks in advance.</p>
