title: Overriding method (early join) and putting "null"
body: <p>Good morning all.
  I thought I knew what does overriding and overloading means and tried to explain it to my friend. Everything was good, but when i came home i decided to write this example.</p>
  
  <pre><code>    public class Car{
  
      public void say(){
          System.out.println("Dodge");
      }
  
      public static void main(String[] args){
          Car c = new Dodge();
          new Car().print(c);
      }
      public void print(Car t){
          System.out.println("Car");
      }
      public void print(Dodge b){
          System.out.println("Dodge");
      }
  }
  
  class Dodge extends Car{
      public void say(){
          System.out.println("Dodge");
      }
  }
  </code></pre>
  
  <p>It's obvious that if we run this code: "Car" will be the output. Because compiler will find method which takes format object Car.
  But what if we change main method like this:</p>
  
  <pre><code>public static void main(String[] args){
      new Car().print(null);
  }
  </code></pre>
  
  <p>The output will be: "Dodge" and i can't figure out why? Can smb explain please?</p>
  
  <p>P.S. I tried wrote also this code:</p>
  
  <pre><code>public class Car{
  
  public void say(){
      System.out.println("Dodge");
  }
  
  public static void main(String[] args){
      new Car().print(null);
  }
  public void print(BigInteger t){
      System.out.println("Car");
  }
  public void print(Double b){
      System.out.println("Dodge");
  }
  </code></pre>
  
  <p>}
  and Idea tells me that: 
  <strong>Ambiguous method call. Both print (BigInteger) in Car and
  print (Double) in Car match</strong>
  This message is obvious. 
  Does hierarchy influence on this and why? Please, tell me what I'm missing.</p>