如何定义枚举类型?
public enum Device {
TARGET("Target"), PAIR("Pair");
}
如何定义带别名的枚举类型?
public enum Device {
TARGET("Target"), PAIR("Pair");
private String fullName;
Device(String fullName) {
this.fullName = fullName;
}
public String getFullName() {
return fullName;
}
}
这个比较好用 哈哈