This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Java in General and the fly likes Enums Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Enums Problem" Watch "Enums Problem" New topic

Enums Problem

Animesh Saxena
Ranch Hand

Joined: Jan 15, 2006
Posts: 62
When i am declaring enums without a class for example consider this class file.

It gives some error in JavaDoc...and where this enum is used in a class. JavaDoc shows some error. Should enums always be in classes even if they are public. Or is there any alternative?

Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
What errors would you be getting?
That's pretty normal code for a simple Enum (they can get a lot more complicated than that).

Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
"some error in JavaDoc" - like what error in JavaDoc?

This is obviously not a SCJD specific question, so I am moving it to Java in General Intermediate.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I compiled and ran javadoc on your enum with no problems. That was in the BlueJ IDE. Perhaps it is some other file in your project causing the problem you are experiencing.

From the command line I get:

[ September 02, 2006: Message edited by: Barry Gaunt ]
rocket mass heater kickstarter
subject: Enums Problem