标签:test win 枚举 int -- inter package sea summer
package cn.zxg.PackgeUse;
/**
* 测试枚举的基本使用
*/
public class TestEnum {
public static void main(String[] args) {
Season a=Season.AUTUMN;
switch (a){
case SPRING:{
System.out.println("春天到了,花开了");
break;
}
case SUMMER:{
System.out.println("夏天到了,该去游泳了");
break;
}
case AUTUMN:{
System.out.println("秋天到了,落叶了");
break;
}
case WINTER:{
System.out.println("冬天到了,去滑雪把");
break;
}
}
}
}
enum Season{
SPRING,SUMMER,AUTUMN,WINTER
}
标签:test win 枚举 int -- inter package sea summer
原文地址:https://www.cnblogs.com/zzzao/p/10909127.html