File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Anybody know how to use  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Anybody know how to use  "enum" in Java?" Watch "Anybody know how to use  "enum" in Java?" New topic

Anybody know how to use "enum" in Java?

Jon Campbell

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){

I agree. Here's the link:
subject: Anybody know how to use "enum" in Java?
It's not a secret anymore!