This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes what are Enums? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what are Enums?" Watch "what are Enums?" New topic
Author

what are Enums?

Sunny Gibbony
Ranch Hand

Joined: May 14, 2008
Posts: 39
I noticed that from Java SE 1.4 to 1.5 that Sun added Enums. I am looking for a simple explanation on what Enums do and the definition of one.

Thanks
Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 90
Enums are constants, Like week days are constant , it wont change. you can put your project constant values into Enum classes.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43900
    
  32
You mean enumerated types with the keyword enum, not to be confused with the related class Enum and the unrelated interface Enumeration.

Try the Java Tutorials, in the first instance, and see whether that helps.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43900
    
  32
Actually, enum members are more than constants. Read the Tutorial link too, Ganzan Ramakrishnan. They are actually collected objects in their own right.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43900
    
  32
More in this thread, with different links.
 
Have you checked out Aspose?
 
subject: what are Enums?
 
It's not a secret anymore!