aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes doubt regarding enum in java 1.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "doubt regarding enum in java 1.5" Watch "doubt regarding enum in java 1.5" New topic
Author

doubt regarding enum in java 1.5

anveshana bandu
Ranch Hand

Joined: Oct 09, 2007
Posts: 42
Hi All

I came to know about a method ordinal() in enums.. in master exam in K&B book.

But i donot know what ordinal method does???so i was unable to attend the bit in master exam....
please let me know what ordinal method does???

Thanks in advance
Sandip Sarkar
Ranch Hand

Joined: Nov 25, 2007
Posts: 55
check out the java 1.5 API...here is a little bit of description and its self explanatory....anywayz if you find it hard to get let me know so that i can code a bit to make you understand...


public final int ordinal()Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero). Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as EnumSet and EnumMap.

Returns:
the ordinal of this enumeration constant

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt regarding enum in java 1.5