Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Any way to access specific element of enumeration?

729894Mar 26 2009 — edited Mar 26 2009
Sorry, if the question sounds too goofy for you. I've just become familiar with enums, and don't understand if there is a way to access any element of enum, just like we do with arrays (arr[3]). All that I know is that we can obtain ordinal of a current enum element and also we can cycle through all enum values using for-each loop. But what if I want to aquire random element of enum. And how can I refer to it, if not by index?
Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2009
Added on Mar 26 2009
2 comments
99 views