java中枚举的使用

来源:互联网 发布:多益网络面试 策划 编辑:程序博客网 时间:2024/05/22 10:26
//一个简单的用户类型枚举public enum UserType {    C(1), HR(2), HH(3);    private int type;    private UserType(int type) {        this.type = type;    }
    //通过提供的这个public的方法获取对应的值    public int getType() {        return type;    }}

0 0
原创粉丝点击