Used to have the program make a descicion. The condition for a switch statement must be an integer expression.
int dayOfWeek = 4;
Ex: switch (dayOfWeek) {
case 6:
System.out.println("Today is saturday!");
break;
case 7:
System.out.println("Today is sunday!");
break;
default:
System.out.println("Looking forward to the weekend!");
}
*default statement will print if dayOfWeek is anything other than 6 or 7*