| Author |
Anybody know how to use "enum" in Java?
|
Jon Campbell
Greenhorn
Joined: Nov 21, 2006
Posts: 5
|
|
The following code compiles, but I don't have any documentation on how to use the "enum" structure. I cant find any info on it in my books or Sun's language documentation... class Test { enum eone { Plus { int operate(int x) { return ++x;} }, Minus { int operate(int x) { return --x;} } } public static void main (String[] args){ System.out.println("eone="+eone.Plus); } }
|
 |
 |
|
|
subject: Anybody know how to use "enum" in Java?
|
|
|