Why static fields (not final) is restricted in inner class in java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1953530/why-does-java-prohibit-static-fields-in-inner-classes">Why does Java prohibit static fields in inner classes?</a>  </p>
</blockquote>



<p>I was going through the specification and got that it is not possible to have the static member in the inner class which is not final compile time constant  . </p>

<pre><code>class HasStatic {
    static int j = 100;
}
class myInnerClassTest {
    class Inner extends HasStatic {
        static final int x = 3;  // OK: compile-time constant
        static int y = 4;  // Compile-time error: an inner class
    }
    static class NestedButNotInner{
        static int z = 5;    // OK: not an inner class
    }
    interface NeverInner {}   // Interfaces are never inner
}
</code></pre>

<p>Whereas i got from the <a href="http://stackoverflow.com/questions/2482327/why-can-we-have-static-final-members-but-cant-have-static-method-in-an-inner-cla">here</a> that it can inherit the static member from its owner class . But why it shouldn't .  what OOPs Prinicipal it hurts  . </p>
