正文Java switch函数IP云V管理员/2022-12-02/0 阅读 12/02提示:扫一扫查出行【扫一扫了解最新限行尾号】复制提示 switch()函数中能放置的值为:byte,short,char,int,string,enum类型或者byte,short,char,int的包装类,其中,string类型是java7(含)之后才支持的,其他类型数据会报错, 报错信息为: Cannot switch on a value of type long. Only convertible int values, strings or enum variables are permitted