This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
As with instance methods and variables, an inner class is associated with an instance of its enclosing class and has direct access to that object's instance variables and methods. Also, because an inner class is associated with an instance, it cannot define any static members itself.
Originally posted by sura watthana: I'm wondering why a non-static member class cannot have static members? could anybody give me a/some reason(s) for it?
I believe this was a design decision to have only "instances" of the inner class provide services, and to not have the inner class itself provide any services. I don't really see any other reason, either. I'd be interested in hearing from someone who knows about this design decision.