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 Enums Problem 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 "Enums Problem" Watch "Enums Problem" New topic
Author

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?


Animesh
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).


42
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Enums Problem
 
Similar Threads
enum public/protected/default/private
SCJP 5: Mock questions
Best practice of mapping collection of enum
can't create enum in inner class
enum static methods