java 枚举示例
public enum YNEnum {
N(0,"否"), Y(1,"是");
private int code;
private String name;
//私有构造函数
private YNEnum(int code,String name) {
this.code = code;
this.name = name;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}