Java switch Statement
Last updated: 28 Sep 2026
switch picks one branch by comparing a value with several cases.
int day = 3;
switch (day) {
case 1: System.out.println("Mon"); break;
case 3: System.out.println("Wed"); break;
default: System.out.println("Other");
}
Without break, execution falls through to the next case.