9,swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上?
Switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。Long,string 都不能作用于swtich。
JAVA面试问题及答案大全
Switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。Long,string 都不能作用于swtich。
JAVA面试问题及答案大全