Enums in inner classes

Declaring Enums in a non-static inner class is explicitly disallowed by the JLS. This is because a nested enum type is implicitly static.

I’m trying to find out why.

Workarounds:
1. Declare inner class as static.
2. Move Enum to outer class/top-level class.

RSS feed for comments on this post · TrackBack URL

Leave a Comment