This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 84
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: 32688
    
    4
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: 32688
    
    4
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: 32688
    
    4
More in this thread, with different links.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: what are Enums?
 
Similar Threads
enums
Am I ready (v. 1001)?
Enums
What is Enums?
Newly added topics in SCJP 1.5