Based on the value of answer , the switch will jump directly to the matching case and perform the statements following the colon. This is more efficient than the if-statements, because of the direct jump—the switch doesn’t repeatedly check every possible value .