Java枚举的小用法

package com.lxc.wmb;

public enum TestEnum {
    Success("200","成功!"),
    Faild("500","错误!");
    
    private String code;
    private String msg;
    
    private TestEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    
    public String getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    
}
原文地址:https://www.cnblogs.com/lxcmyf/p/8651193.html