public enum SeasonState { SPRING("春天"), SUMMER("夏天"), AUTUMN("秋天"), WINTER("冬天"); String name; SeasonState(String name) { this.name = name; } @Override public String toString() { return name; } }
@Test public void test43() { System.out.println(SeasonState.SPRING); System.out.println(SeasonState.SUMMER); System.out.println(SeasonState.AUTUMN); System.out.println(SeasonState.WINTER); }
标签:name,System,SeasonState,String,println,out From: https://www.cnblogs.com/mingruifeng/p/17013276.html