method overriding
<pre><code>
class A
{
  int i=10;
  void show()
  {
    System.out.println("class A");
  }
}

class B extends A
{
  int i=5;
  public void show()
  {
    System.out.println("class B");
  }
}
class M
{
  public static void main(String s[])
  {
    A a=new B();
    a.show();
    System.out.println(a.i);
  }
}


OUTPUT= class B
        10

</code></pre>

<p>If class A method is overridden by class B method then why not the variable 'i'?</p>
