課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)
為什么最后是+three啊
2018-07-15
源自:Java入門第一季(IDEA工具) 3-3
正在回答
你輸出一段代碼 做的運(yùn)算 輸出算式 就要在后面加一個(gè)加號(hào) 才能輸出算式結(jié)果 +three中three是計(jì)算運(yùn)行后的three 是你想得到的
這個(gè)代碼輸出了兩段內(nèi)容,第一段“”,第二段是three的值,加號(hào)表示連接。第一段為空值,加不加都可以的。
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)該都是字符串類型的吧
能給出代碼嗎???
舉報(bào)
0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語(yǔ)法開始
2 回答為什么最后還要+three?
2 回答為什么后面寫+three
3 回答three-=one----------------three=three-one的值不是20嗎,為什么是30?
2 回答為什么后面都要+three
1 回答為什么要有引號(hào)啊"three = one + two ==> "+three
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-07-23
你輸出一段代碼 做的運(yùn)算 輸出算式 就要在后面加一個(gè)加號(hào) 才能輸出算式結(jié)果 +three中three是計(jì)算運(yùn)行后的three 是你想得到的
2018-07-22
這個(gè)代碼輸出了兩段內(nèi)容,第一段“”,第二段是three的值,加號(hào)表示連接。第一段為空值,加不加都可以的。
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
能給出代碼嗎???