is boolean allowed in a switch statement in java code example
Example: can switch statements in java work with boolean
The expression in the switch statement must be of type char, byte, short, or int. It cannot be boolean, float, double, or String.