zz switch的参数类型

from:http://esyscn.com/thread-73353-1-1.html

关于switch的参数类型

switch  expr1 )中, expr1 是一个整数表达式,整数表达式可以是int基本类型或Integer包装类型,由于, byte,short,char都可以隐含转换为 int ,所以,这些类型以及这些类型的包装类型也是可以的。因此传递给 switch  case 语句的参数应该是 int  short  char 或者 byte。    long,string 都不能作用于 swtich 

posted @ 2011-05-07 14:37  little rookie  阅读(306)  评论(0编辑  收藏  举报