Sentil, Looking at JLS (�8.1.2),following can be concluded An inner class is a nested class that is not explicitly or implicitly declared static unlike member inner interface which are always implicitly static. Inner classes may not declare anything static like static initializers or member interfaces and static members unless they are compile time constants fields. Inner classes may inherit static members that are not compile-time constants even though they may not declare them.
Below is a code which demonstrates all the above statements.
Hope this will help. [ November 18, 2006: Message edited by: Sanjeev Kumar Singh ]
Perhaps I can try to do Prabhu's job at least partial. I do not know the exact answer, but in the case of inherited static members, an outer instance is not necessary. You can access the static fields via the class names:
I think for non-static inner classes it must be so, that if they inherit from a super class, they must inherit everything, regardless if the fields are static or not. But it won't compile if you make new static fields (or hide / "override" the inherited ones).
But you are right, it's a bit against the logic.
all events occur in real time
Joined: Nov 01, 2006
but in the case of inherited static members, an outer instance is not necessary. You can access the static fields via the class names
This quote is really very important.For the time being I am burning this concept what Prabhu described and you replied. Hey why you have written override
But it won't compile if you make new static fields (or hide / "override" the inherited ones).
Static methods can be made hidden only not overriden.