1.无参数
public enum TYPE { INSERT, UPDATE, DELETE; }
2.带参数:
public enum Topics { OK(0, "成功"), xx(100, "错误A"), yyy(200, "错误B"); Topics(int number, String description) { this.code = number; this.description = description; } private int code; private String description; public int getCode() { return code; } public String getDescription() { return description; } }