http://xiangai.taobao.com
http://shop148612228.taobao.com

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;
}
}

 

posted @ 2019-11-13 16:46  万事俱备就差个程序员  阅读(252)  评论(0编辑  收藏  举报

http://xiangai.taobao.com
http://shop148612228.taobao.com
如果您觉得对您有帮助.领个红包吧.谢谢.
支付宝红包
微信打赏 支付宝打赏