枚举类

来源:互联网 发布:小老头软件官网 编辑:程序博客网 时间:2024/06/16 18:51

-------------------枚举类对象-----------------------

package enums;

public enum number {
    zero(0,"零"),
    one(1,"壹"),
    two(2,"贰"),
    three(3,"叁"),
    four(4,"肆"),
    five(5,"伍"),
    six(6,"陆"),
    seven(7,"柒"),
    night(8,"捌"),
    nine(9,"玖"),
    ten(10,"拾"),
    hundred(100,"百"),
    thousand(1000,"千"),
    wan(10000,"万");
    int value;
    String description;
    private number(int value,String description){
    this.value=value;
    this.description=description;
    }
    public int Value() {
        return this.value;
    }
    public String toStringg(int value) {
        return String.valueOf(this.value);
    }
}
原创粉丝点击