為什么錯(cuò)誤了
public class HelloWorld{
? ? public static void main(String[] args) {
int score=68;
String mark =(score>=60) ? "及格":"不及格";
System.out.println("考試成績(jī)?nèi)绾危?+mark);
}
}
public class HelloWorld{
? ? public static void main(String[] args) {
int score=68;
String mark =(score>=60) ? "及格":"不及格";
System.out.println("考試成績(jī)?nèi)绾危?+mark);
}
}
2020-11-19
舉報(bào)
2022-09-12
在idea下"String mark =(score>=60) ? "及格":"不及格";"后面的分號(hào)是中文格式的
2021-04-11
不要使用中文的標(biāo)點(diǎn)符號(hào),會(huì)出錯(cuò)
2021-01-28
(score>=60) 把這個(gè)括號(hào)去掉試試
2020-11-19
String mark =(score>=60) ? "及格":"不及格";
這一行的分號(hào)改成英文狀態(tài)的分號(hào)就可以了