這個(gè)有問(wèn)題??
public class HelloWorld{ ? ?public static void main(String[] args) { int score=68; String mark =(score>=60) ? "及格" :"不及格"; System.out.println("考試成績(jī)?nèi)绾危?+mark); } } 哪里錯(cuò)了呢
public class HelloWorld{ ? ?public static void main(String[] args) { int score=68; String mark =(score>=60) ? "及格" :"不及格"; System.out.println("考試成績(jī)?nèi)绾危?+mark); } } 哪里錯(cuò)了呢
2016-06-28
舉報(bào)
2016-06-28
及格與不及格之間的冒號(hào)是在中文狀態(tài)下輸入的,切換到英文狀態(tài)下就好了!
2016-06-28
把你的代碼放到eclipse裏就知道你的冒號(hào)是中文的,改了就好了
2016-06-28
中文下寫的符號(hào),以及 有空格。好像在及格與不及格直接。
2016-06-28
ok,,
2016-06-28
有可能是冒號(hào)或者引號(hào)實(shí)在中文輸入狀態(tài)下輸入的,你自己檢查一下