Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    'static inner' is a contradiction in terms. Commented Nov 28, 2014 at 3:47
  • 7
    It is not convention that defines inner class as a non-static nested class, but the JLS. docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.1.3 Commented Jul 1, 2016 at 22:51
  • 1
    And the terms are not 'used interchangeably'. Commented Jan 20, 2018 at 0:25
  • You almost always want static/nested inner classes because they behaves like a class should. Non-static classes have access to the containing instance and don't have independent existence in the usual sense. if you do want access to the containing instance, maybe you should be using fields and encapsulation instead. Not saying you're wrong but make sure you check before you do a big refactoring. Commented Sep 7, 2025 at 7:18