課程
/后端開(kāi)發(fā)
/Java
/Java入門(mén)第一季(IDEA工具)升級(jí)版
?????? int one = 10 ;??????? int two = 20 ;??????? int three = 0 ;
three+=one;
?System.out.println("thrree+= ==> "+three);
為什么得出的結(jié)果是40,不應(yīng)該是10嗎?
2015-12-23
源自:Java入門(mén)第一季(IDEA工具)升級(jí)版 3-3
正在回答
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=one+two?==>?"+three); ????????three+=one; ????????System.out.println("three+=?==>?"+three); ????????three-=one; ????????System.out.println("three-+"+three); ????????three*=one; ????????System.out.println("three*="+three); ????????three/=one; ????????System.out.println("three/="+three); ????????three%=one; ????????System.out.println("three%="+three);
你好,three+=one; 這一句的意思是,three + one 賦值給 three,這里上面已經(jīng)運(yùn)行過(guò)?three=one+two;?
所以到?three+=one; 這一步的時(shí)候 three 的值是 30;運(yùn)行?three+=one; 后相當(dāng)于 three = 30 + 10;
因此,得到的 three 的值是 40;望樓主采納!
死神少 提問(wèn)者
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=one+two?==>?"+three);?//30 ????????three+=one; ????????System.out.println("thrree+=?==>?"+three);??//40 ????????three-=one; ????????System.out.println("three-+"+three);????//30 ????????three*=one; ????????System.out.println("three*="+three);????//300 ????????three/=one; ????????System.out.println("three/="+three);????//30 ????????three%=one; ????????System.out.println("three%="+three);????//0
哪里???
舉報(bào)
0基礎(chǔ)萌新入門(mén)第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語(yǔ)法開(kāi)始
1 回答%這是求余,請(qǐng)問(wèn) 下面代碼中 是怎么計(jì)算呢
1 回答求余是怎樣計(jì)算的
6 回答請(qǐng)問(wèn)邏輯運(yùn)算符在這道題里怎么用
1 回答num/=10是什么意思呀怎嘛計(jì)算的。
3 回答【Help】 if ( i%2 == 1 ) { //怎么計(jì)算的
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2015-12-23
你好,three+=one; 這一句的意思是,three + one 賦值給 three,這里上面已經(jīng)運(yùn)行過(guò)?three=one+two;?
所以到?three+=one; 這一步的時(shí)候 three 的值是 30;運(yùn)行?three+=one; 后相當(dāng)于 three = 30 + 10;
因此,得到的 three 的值是 40;望樓主采納!
2015-12-23
2015-12-23
哪里???