34,333
edits
Changes
→Using the switch Statement Syntax
Finally, the ''default'' section of the construct defines what should happen if none of the case statements present a match to the ''value''.
== A switch Statement Example==
With the above information in mind we may now construct a ''switch'' statement which provides the same functionality as our previous, and somewhat unwieldy ''if ... else'' construct: