1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| public enum EnumColumn { key1(valve1), key2(valve2), key3(valve2);
private String type;
EnumColumn(String type) { this.type = type; }
@Override public String toString() { return String.valueOf(this.type); } } public static void main(String[] args) {
EnumColumn enumColumn1 = EnumColumn.valueOf(key1); EnumColumn enumColumn2 = EnumColumn.key2; System.out.println(groupColumn1.name()); System.out.println(groupColumn1.toString()); System.out.println(groupColumn1.type); }
|