The switch is also familiar from Java. A test expression is compared to each case expression, and the one that matches, if any, is executed. If none matches, and default is present, that is executed. Each case needs a break to end the case. C limits the expression and constants to integer types, while Java allows strings.