Object vs String Method
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1572322/overloaded-method-selection-based-on-the-parameters-real-type">Overloaded method selection based on the parameter’s real type</a><br>
  <a href="http://stackoverflow.com/questions/13033037/how-is-an-overloaded-method-choosen-when-a-parameter-is-the-literal-null-value">How is an overloaded method choosen when a parameter is the literal null value?</a>  </p>
</blockquote>



<p>When I execute the code below, I get the following output:</p>

<blockquote>
  <p>Method with String argument Called ..."</p>
</blockquote>

<p>Why?</p>

<pre><code>public class StringObjectPOC {

    public static void test(Object o)   {
        System.out.println("Method with Object argument Called ...");
    }
    public static void test(String str){
        System.out.println("Method with String argument Called ...");
    }
    public static void main(String[] args) {
        StringObjectPOC.test(null);
    }
}
</code></pre>
