課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)升級版
為什么最后是+three啊
2018-07-15
源自:Java入門第一季(IDEA工具)升級版 3-3
正在回答
你輸出一段代碼 做的運算 輸出算式 就要在后面加一個加號 才能輸出算式結(jié)果 +three中three是計算運行后的three 是你想得到的
這個代碼輸出了兩段內(nèi)容,第一段“”,第二段是three的值,加號表示連接。第一段為空值,加不加都可以的。
public class HelloWorld{
? ? public static void main(String[] args) {
? ?int one = 10 ;
? ? ? ? int two = 20 ;
? ? ? ? int three = 0 ;
? ? ? ? three=one+two;
? ? ? ? System.out.println(""+three);
? ? ? ? three+=one;
? ? ? ? three-=one;
? ? ? ? three*=one;
? ? ? ? three/=one;
? ? ? ? three%=one;
}
代表兩字符串的鏈接,你前面加的應(yīng)該都是字符串類型的吧
能給出代碼嗎???
舉報
0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語法開始
2 回答為什么最后還要+three?
2 回答為什么后面寫+three
2 回答為什么后面都要+three
3 回答three-=one----------------three=three-one的值不是20嗎,為什么是30?
1 回答為什么要在==》后面+three
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-07-23
你輸出一段代碼 做的運算 輸出算式 就要在后面加一個加號 才能輸出算式結(jié)果 +three中three是計算運行后的three 是你想得到的
2018-07-22
這個代碼輸出了兩段內(nèi)容,第一段“”,第二段是three的值,加號表示連接。第一段為空值,加不加都可以的。
2018-07-16
public class HelloWorld{
? ? public static void main(String[] args) {
? ?int one = 10 ;
? ? ? ? int two = 20 ;
? ? ? ? int three = 0 ;
? ? ? ? three=one+two;
? ? ? ? System.out.println(""+three);
? ? ? ? three+=one;
? ? ? ? System.out.println(""+three);
? ? ? ? three-=one;
? ? ? ? System.out.println(""+three);
? ? ? ? three*=one;
? ? ? ? System.out.println(""+three);
? ? ? ? three/=one;
? ? ? ? System.out.println(""+three);
? ? ? ? three%=one;
? ? ? ? System.out.println(""+three);
}
}
2018-07-15
代表兩字符串的鏈接,你前面加的應(yīng)該都是字符串類型的吧
2018-07-15
能給出代碼嗎???