//定义枚举类
public enum TestEnum{
//枚举全部大写
YSE(1,"通过"),
NO(0,"不通过”);
private Integer code;
private String name;
private TestEnum(Integer code ,String name){
this.code = code;
this.name = name;
}
//只提供get 方法
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
java 常用定义枚举
最新推荐文章于 2024-05-11 20:53:57 发布