aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is Enum? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What is Enum?" Watch "What is Enum?" New topic
Author

What is Enum?

Arun Kumar Gaddam
Ranch Hand

Joined: May 05, 2007
Posts: 58
hai friends ,iam new java 5
Can any body explain me what is an Enum?
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Originally posted by Arun Kumar Gaddam:
hai friends ,iam new java 5
Can any body explain me what is an Enum?




public abstract class java.lang.Enum implements java.lang.Comparable, java.io.Serializable {}




Output:
true
class java.lang.Enum


Thanks,


cmbhatt
Faisal Ahmad
Ranch Hand

Joined: Aug 31, 2006
Posts: 340

Originally posted by Arun Kumar Gaddam:
hai friends ,iam new java 5
Can any body explain me what is an Enum?

enum is a Java keyword used in defining enumerated list of constants. It also declares a class of type "enum". You can declare methods and variables too! Its also allowed to implement interfaces. Well, there is lot more that you can do with enum in Java than its counterparts in C++/C/C#!
Check this link for a very good introduction and explanation http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html
Its very short too!
PS: By the way, enumeration means a numbered list!
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You can also read the Enums section of Sun's Java Tutorial


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is Enum?
 
Similar Threads
What is the usage on enum types?
retrieve enumeration datatype into jsp
Enum
How to define constants for several classes?
abstract method within an enum ?