my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt regarding enum in java 1.5
 
Similar Threads
NaN
Bonus master exam
enums' ordinal ?
Locales and Ordinal values
mock question