Skip to content

Outdated statement about inner class static members #228

@cmodii

Description

@cmodii

Location: https://dev.java/learn/classes-objects/nested-classes/

Under the 'Inner Classes' section it states:

...Also, because an inner class is associated with an instance, it cannot define any static members itself.

Which is outdated since post Java 16 non-static inner classes can declare static members

Per the Java 16 Specification:

In particular, an inner class may declare and inherit static members (§8.2), and declare static initializers (§8.7), even though the inner class itself is not static.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions