title: Jave : Parent method is called when ambiguity in Inheritance
body: <p>Considering the following:</p>
  
  <pre><code>class Parent {
      public void print(Object s) {
          System.out.println("I am inside Parent Object Method.");
      }
  }
  
  public class Child extends Parent{
  
      public void print(String s) {
          System.out.println("I am inside Child String Method.");
      }
  
      public static void main(String arg[]) {
          Parent a = new Child();
          a.print(null);
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>I am inside Parent Object Method
  </code></pre>
  
  <p>Here JVM is calling Parent Method in place of child method regardless of the logic of "more specific method should be called" in ambiguity.</p>
  
  <p>What would be the reason for this implementation in java?</p>