Home >Topic List >switch statement usage
Switch statement usage: 1. The Switch statement can only be used for integer types, enumeration types and String types, and cannot be used for floating point types and Boolean types; 2. Each case statement must be followed by a break statement to prevent other cases from being executed. The code block without a break statement will continue to execute the code block of the next case; 3. Multiple values can be matched in one case statement, separated by commas; 4. The default code block in the Switch statement is optional, etc. wait.