[Java] static vs non-static nested classes


An inner class cannot be static, so I am going to recast your question as "What is the difference between static and non-static nested classes?". 

A non-static nested class (or 'inner class') has full access to the members of the class within which it is nested. A static nested class does not have a reference to a nesting instance, so a static nested class cannot invoke non-static methods or access non-static fields of an instance of the class within which it is nested.

Comments