jdk和语言等级都设定好了,不知道为什么switch的判定不能用string
switch中支持的类型:byte、char、short、int、enum、String修改如下:
String temp=sc.next(); switch(temp)
sc是对象,不是字符串,改为 sc.next()