1) The expression used in switch must be integral type ( int, char and enum). Any other type of expression is not allowed .
Read moreWhich data type variable can be used in switch statement?
The variable used in a switch statement can only be a short, byte, int or char . The values for each case must be the same data type as the variable type.
Read more