class TestSwitch3
{
public static void main(String[] args)
{
String season ="SPRING";
switch(season){
case "SPRING":
System.out.println("春天");
break;
case "SUMMER":
System.out.println("夏天");
break;
case "AUTUMN":
System.out.println("秋天");
break;
case "WINTER":
System.out.println("冬天");
break;
default:
System.out.println("输入有误");
break;
}
}
}
转载于:https://blog.51cto.com/9815936/1600298