- 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.