title: get super class value in java
body: <p>I have 2 classes:</p>
  
  <pre><code>public class A
  {    
      int n = 10;    
  
      public int getN()
      {
          return n;
      }    
  }
  
  public class B extends A
  {    
      int n = 20;
  
      public int getN()
      {
          return n;
      }
  }
  
  public class Test
  {    
      public static void main(String[] args)
      {           
          B b = new B();
          System.out.println(b.getN()); //--&gt; return 20
          System.out.println(((A)b).getN()); //--&gt; still return 20. 
                                             //How can I make it return 10?
      }
  }
  </code></pre>