106运用SWITCH语句打印星期几的单词

package com.chongrui.test;
/*
运用SWITCH语句打印星期几的单词
* */

public class TypeConvertion {

public static void main(String[] args){

System.out.println("今天星期几");
int week = 6;
switch(week){
case 1:  //case后面要常量
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
case 3:
System.out.println("Wednesday");
break;
case 4:
System.out.println("Thursday");
break;
case 5:
System.out.println("Friday");
break;
case 6:
System.out.println("Saturday");
break;
case 7:
System.out.println("Sunday");
default:
System.out.println("Sorry,I don't know");
break;

}


}

}

上一篇:STL容器与配接器


下一篇:ECMA中的switch语句