Java Programming Tutorial – 12 – Switch Statement

By | 2015년 8월 2일


package apples;

public class apples {

    public static void main(String[] args) {
		int age;
		age =7;
		
		switch (age)
		{
		case 1:
			System.out.println("You can crawl");
			break;
		case 2:
			System.out.println("You can talk");
			break;
		case 3:
			System.out.println("You can get in trouble");
			break;
		default:
			System.out.println("I dont know how old you are");
			break;
		}
	}

}

Print Friendly, PDF & Email