title: Assinging object of inherited class to reference of super class
body: <p>Given the follwoing Code:</p>
  
  <pre><code>public class A {
       int at=2;
  
      public int m(int i){return at+i;}
  }
  
  class B extends A {
       int at=3;
  
          public int m(int i){return at+5*i;}
  }
  
  public class Main {
  
      public static void main(String args[]){
          A x = new B();
  
          System.out.println("Output "+x.m(x.at));
      }
  }
  </code></pre>
  
  <p>The output is 13.</p>
  
  <p>How does it work?
  I know that it takes method from B, but what about arguments?</p>