swtich 是否能作用在 byte 上,是否能作用在 long 上,是否能作用在 String 上 ?
switch ( expr1 )中, expr1 是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int 、 short 、 char 或者 byte 。 long,string 都不能作用于 swtich
本文解析了在Java中switch语句可以接受的数据类型,包括int、short、char和byte等整数类型,并明确指出其不支持long和String类型的使用。
swtich 是否能作用在 byte 上,是否能作用在 long 上,是否能作用在 String 上 ?
switch ( expr1 )中, expr1 是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int 、 short 、 char 或者 byte 。 long,string 都不能作用于 swtich
261

被折叠的 条评论
为什么被折叠?