• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

enums' ordinal ?

 
Mamadou Touré
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was doing the mock exam provided with the CD of B&K book, when I come accross something strange, a method called ordinal(). There is nowhere in the book were we talked about this method for the enums . Do you have an idea of what it is ?

Regards
[ May 16, 2008: Message edited by: Bear Bibeault ]
 
Joe Fischer
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Description of the ordinal() method is in the Sun Javadocs for the java.lang.Enum class. It's the 0-based position of the enum in the declaration of enums. Also says it's not very useful except for specialized collections. Other than that I don't know why you would want to know the declared position of an enum.
 
Mamadou Touré
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe,

As I said, I encoutered it on the mock exam provided with the K&B CD.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic