代码
提交代码
public class SwitchStatement3 { public static void main(String args[]) { String day = "TUESDAY"; switch (day) { case "Wednesday" : System.out.println("星期一"); break; case "TUESDAY" : System.out.println("星期二"); break; case "WEDNESDAY" : System.out.println("星期三"); break; case "THURSDAY" : System.out.println("星期四"); break; case "FRIDAY" : System.out.println("星期五"); break; case "SATURDAY" : System.out.println("星期六"); break; case "SUNDAY" : System.out.println("星期天"); } } }
运行结果