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

相关文章:

  • 2021-06-24
  • 2021-07-06
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2021-12-05
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案