Calling static methods on object instances and a side note Java
<p>I was looking of some of the questions, and it lead me to this issue. When you call a static method on a object instances, does it resolve dynamically or statically for example:</p>

<pre><code>class A
{
     public static foo() {}
}
class B extends A
{
     public static foo() {}
}
[...]
public static void main(String[] args)
{
     A a = new B();
     a.foo(); // does this all A foo or B foo?
}
</code></pre>

<p>why I'm asking this is because it would explain why static methods can't be abstract.  Because if A was an interface this would not work if foo was abstract and static.</p>

<p>How does this work internally? Basically how does is know that foo is static to begin with if it doesn't do anything dynamic? Doesn't it still have to inspect the class? Also if it know a is really a B why doesn't it call foo on B?</p>
