This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Enum in private inner class." Watch "Enum in private inner class." New topic
Author

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.
 
Similar Threads
doubt in enum code
Strange Enum behaviour?
Inner Classes
Timer task
Enum inside an Enum