swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上?

答:switch(expr1)中,expr1是一个整型,字符或字符串,因此可以作用在byte和long上,也可以作用在string上。

原文地址:https://www.cnblogs.com/mianshi/p/1926643.html