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; } }
© 著作权归作者所有
举报
相关热门文章
发表评论
0/200