課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)升級版
哪個地方錯了
2018-12-08
源自:Java入門第一季(IDEA工具)升級版 3-7
正在回答
你的score一會是int,一會是String,分數(shù)和評價應(yīng)該用兩個變量表示
public class HelloWorld{??? public static void main(String[] args) {??int score=68;??String mark ="";??if(score>=60){????? mark="及格";??}else{????? mark="不及格";??}??System.out.println("考試成績?nèi)绾危?+mark);?}}
score是int類型的變量,你給它賦了個字符串,當(dāng)然會報錯
public class HelloWorld{??? public static void main(String[] args) {??int score=68;? if(score>=60){? ? ???System.out.println("考試成績?nèi)绾危杭案?);
??}else{????? ?System.out.println("考試成績?nèi)绾危翰患案?);??}?}}
}
舉報
0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語法開始
3 回答用return方法怎么寫
2 回答這種數(shù)字金字塔怎么寫
1 回答就只有這種方法嗎?
2 回答怎么第一種方法就亂碼了呢?
3 回答這種寫法為什么不正確呢?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-12-08
你的score一會是int,一會是String,分數(shù)和評價應(yīng)該用兩個變量表示
public class HelloWorld{
??? public static void main(String[] args) {
??int score=68;
??String mark ="";
??if(score>=60){
????? mark="及格";
??}else{
????? mark="不及格";
??}
??System.out.println("考試成績?nèi)绾危?+mark);
?}
}
2019-04-16
score是int類型的變量,你給它賦了個字符串,當(dāng)然會報錯
2019-01-15
public class HelloWorld{
??? public static void main(String[] args) {
??int score=68;
? if(score>=60){
? ? ???System.out.println("考試成績?nèi)绾危杭案?);
??}else{
????? ?System.out.println("考試成績?nèi)绾危翰患案?);??}
?}
}
}