Within a switch statement, the break keyword stops the execution of more code and case testing.
Source Code
int day = 2;
switch (day) {
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
// Additional cases
}
Always use break in each case of your switch statements unless you intentionally want to “fall through” to the next case.