Java switch函数

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

原文地址:https://www.cnblogs.com/motong/p/10053824.html