enums in Java

Hey everyone. I know that this is a C++ site, but I'd really appreciate any help.

I've been learning Java in class lately and right now I'm looking at enumerations. In C++, you can "change the position" of a value right (sorry for the improper use of terminology)? For example (from the tutorial on this site):

1
2
3
enum months_t { january=1, february, march, april,
                may, june, july, august,
                september, october, november, december} y2k;


This would assign january to position 1 as opposed to position 0.

When I try something similar in Java, it gives me a bunch of errors as that one error throws everything else off (I don't think the errors are relevant are they as I'm just wondering if it's possible?). I've googled extensively, and the tutorial things on the oracle site don't show anyway of doing the above, so I would like to ask if anyone here knew if there was such a feature in Java (I'm using version 6).

Again, any help is greatly appreciated.
You will get more help here : http://forums.oracle.com/forums/category.jspa?categoryID=285

Enums : http://download.oracle.com/javase/1,5.0/docs/guide/language/enums.html
Looks like in Java, enum is very similar to a class.
Hi,

Thank you for the links. I guess enums in Java are a little more than what I was looking for.
Topic archived. No new replies allowed.