Switch statement

class jamesprogram {

	public static void main(String args[]){
			
		int age;
		age = 4;
		
		switch(age){
			
			case 1:
			System.out.println("Age is 1");
				break;
			
			case 2:
				System.out.println("Age is 2");
				break;
				
			case 3:
				System.out.println("Age is 3");
				break;
				
			case 4:
				System.out.println("Age is 4");
				break;
		}	
	}
}

Leave a Reply