switch多分枝语句

package lianxi;
//switch多分枝语句

import java.util.Scanner;

public class GetSwitch {

    public static void main(String[] args) {    
        
        int week=3;
        switch(week){
        case 1:
            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("Firday");
            break;
            
        case 6:
            System.out.println("Saturday");
            break;
            
        case 7:
            System.out.println("Sunday");
            break;
            
            default:
                System.out.println("Sorry i don't know");
        }

    }

}

 

posted @ 2016-01-04 16:02  梦里梦到梦  阅读(180)  评论(0编辑  收藏  举报