public class Constant {
......
public enum Status {
ERROR,
WARNING,
NORMAL
}
......
}
After compiling I got a class file named
You'll be able to access it elsewhere like
import package.name.Constant;
//...
Constant.Status foo = Constant.Status.ERROR;
or,
import package.name.Constant;
import package.name.Constant.Status;
//...
Status foo = Status.ERROR;
To get the declared name of any enum
element, use Enum#name():
Status foo = ...;
String fooName = foo.name();