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!

Can Enums SKip Values

807603Jan 22 2008 — edited Jan 23 2008
I haven't worked with Enums in awhile, but I was wondering if it can skip values.

For instance, I am implementing a spec that has error codes in it that for some reason skip some values.

They go 1,2,3,4,5,6,8,10,11 skipping 7 and 9

I'd like to make an enum for these constants, but I don;t think this is possible.

I can always use static final int if needed
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2008
Added on Jan 22 2008
31 comments
3,353 views