case

The case keyword can only be used within a switch statement block. It is used repeatedly to provide any number of unique constants (or numeric labels) for comparison within a switch statement block. If the case constant equals the value of the expression at the top of the switch statement, then control is passed to the statement immediately following the case statement. If, on the other hand, the expression at the top of the switch statement block and the case label do not match, control is passed to the next case for comparison.

In the event that no case constants match the value of the expression given at the top of the switch statement, often a default case is provided.

For an example of how the case keyword can be used, see the keyword switch.