1280 学生们参加各科测试的次数

第3课 - 启航Lua之路

  返回  

enum枚举类联系:四季

2021/8/21 21:01:43 浏览:
/**
 * @author looper
 * @
 **/
public class SeasonTest {

    public static void main(String[] args) {

        Season seasonspring = Season.SPRING;
        System.out.println(seasonspring);
    }

}

enum Season {
    SPRING("春天", "春暖花开"),

    SUMMER("夏天", "夏日炎炎"),

    FALL("秋天", "秋高气爽"),

    WINTER("冬天", "白雪皑皑");

    private final String seasonName;
    private final String seasonDesc;

    private Season(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;

    }

    public String getseasonName() {
        return seasonName;
    }

    public String getseasonDesc() {
        return seasonDesc;
    }

    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }

    @Override
    public String toString() {
        return
                seasonName + '\'' +
                        seasonDesc + '\''
                ;
    }
}

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号