我有一个看起来像这个例子的枚举
public enum Animals {
Cat("Cat", "fluffy animal"),
Dog("Dog", "barking animal");
private String name;
private String description;
}
Animals(String name, String description){
this.name = name;
this.description = description;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
从课外我如何获得名称和描述字符串?
相关分类