switch ( expr1 )中, expr1 是一個整數表達式。因此傳遞給 switch 和 case 語句的參數應該是 int 、 short 、 char 或者 byte 。 long,string 都不能作用于 swtich 。