switch语句的判断条件可以接受int,byte,char,short,不能接受其他类型
只有JDK版本1.7以上才可以支持String

设置如下可解决问题:(若没有JDK1.7版,可下载一下安装)
菜单选项--》project->properties->java compiler->compiler compliance level:选1.7即可

android switch(String)错误:Cannot switch on a value of type String for source level below 1.7...


相关文章:

  • 2021-11-16
  • 2021-11-05
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-07-10
相关资源
相似解决方案