java枚举

public enum TestTypeEnum {
    TEST("CODE", "name", "other");

    private final String remark;

    private final String type;

    private final String other;

    TestTypeEnum(String type, String remark, String other) {//自定义构造方法
        this.remark = remark;
        this.type = type;
        this.other = other;
    }

    public String getRemark() {
        return remark;
    }

    public String getType() {
        return type;
    }

    public String getOther() {
        return other;
    }

    public static void main(String[] args) {
        TestTypeEnum t = TestTypeEnum.TEST;
        System.out.println(t.getType());
        System.out.println(t.getRemark());
        System.out.println(t.getOther());
    }

}

 

posted @ 2019-03-13 15:29  宇枫  阅读(181)  评论(0编辑  收藏  举报