class Ques0357{
public static void main(String[] argv){
int s = 2;
switch (s) {
case 1:
System.out.println(”Fred”);
break;
case 2:
System.out.println(”Fast”);
case 3:
System.out.println(”Tech”);
default:
System.out.println(”default”);
}
}
}
The break statement is used inside the code block following the switch statement to terminate the execution of a statement sequence. As soon as a break statement is encountered, the program control is transferred to the first line of code that follows the entire switch statement.