📜  java 在枚举中使用空间 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:45.997000             🧑  作者: Mango

代码示例1
public enum MyEnum {
    INDIA("India"),
    RUSSIAN("Russian"),
    ENGLAND("England"),
    NORTH_AMERICA("North America");    

    private String name;

    MyEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }    
}