Back to Intellij Community

PublicInnerClass

java/java-impl/resources/inspectionDescriptions/PublicInnerClass.html

2025.3-rc-2480 B
Original Source

Reports public nested classes.

Example:

public class Outer {
    public static class Nested {} // warning
    public class Inner {} // warning
    public enum Mode {} // warning depends on the setting
    public interface I {} // warning depends on the setting
  }

Configure the inspection:

  • Use the Ignore 'public' inner enums option to ignore public inner enums.
  • Use the Ignore 'public' inner interfaces option to ignore public inner interfaces.