T
Thomas Hawtin
iherage said:In C++, by default, the first enumerator has a value of 0, and each
successive enumerator is one larger than the value of the previous one,
unless you explicitly specify a value for a particular enumerator.
What about in Java ( JDK 5.0)? Can I assign a value to the particular
enumerator?
I have googled for it and found nothing. Does anyone know?
http://download.java.net/jdk6/docs/api/java/lang/Enum.html#ordinal()
You can also, of course, add methods to your enum to return whatever
value you like.
Tom Hawtin