- public enum EOrderTyper {
- NormalOrder(0, "一般订单"),
- VDDmoney(50, "虚拟订单"),
- PDDmoney(51, "礼品卡订单");
- private int orderType;
- private String description;
- private EOrderTyper(int type, String desc) {
- this.orderType = type;
- this.description = desc;
- }
- public int getOrderType() { return this.orderType; }
- public String getDescription() { return this.description; }
- }
- ////
System.out.println(EOrderTyper.NormalOrder.getOrderType());
//输出: 0System.out.println(EOrderTyper.VDDmoney.getDescription());
//输出: 虚拟订单
枚举类enum 构造函数 -- study20180420
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.