title: Inheritance in Static Methods
body: <p>Why does the below code print "Main"?</p>
  
  <pre><code>public class Main
  {
      public static void method()
      {
          System.out.println("Main");
      }
  
      public static void main(String[] args)
      {
          Main m = new SubMain();
          m.method();
      }
  }
  
  class SubMain extends Main
  {
      public static void method()
      {
          System.out.println("SubMain");
      }
  }
  </code></pre>
  
  <p>At runtime, <code>m</code> is pointing to an instance of <code>Submain</code>, so it should conceptually print "SubMain". </p>