Java Casting with Method Calls
<p>Suppose I have the following classes</p>

<pre><code>class A{
    public method(A a) {
        System.out.println(3);
    }
}

class B extends A{
  public void method (A a) {
        System.out.println(2);
  }
  public void method (B b) {
        System.out.println(1);
  }
}

A obj = new B();
obj.method( (B) obj);
((B) obj).method( (B) obj);
</code></pre>

<p>The first method call prints out 2 while the second method call prints out 1.  Why don't both method calls print out 1?</p>
