在jdk 1.6版本中,switch的参数无法使用String类型,只支持int,char,enum类型。 1.6版本之前不支持switch语句存在字符串的判断,升级到1.7或1.8及以上版本即可。 相关文章: 2022-12-23 2021-06-10 2022-12-23 2021-05-25 2021-08-24 2021-10-27 2021-08-16 2021-12-09