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
posted 8 years ago
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.