jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes Enum in private inner class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Enum in private inner class." Watch "Enum in private inner class." New topic

Enum in private inner class.

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Why do I get a compiler error by putting enum SortKey inside the inner class?

Error:The member enum SortKey must be defined inside a static member type

comp.lang.javascript FAQ: http://jibbering.com/faq/
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
enums are implicitly static
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
...and inner classes cannot have static members. Logical consequence is that inner classes cannot declare enums.
I agree. Here's the link: http://aspose.com/file-tools
subject: Enum in private inner class.
It's not a secret anymore!