第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

three1是30.three1*=one應(yīng)該是300啊。為什么是400?

public class HelloWorld{

? ? public static void main(String[] args) {

? ? int one = 10 ;

? ? ? ? int two = 20 ;

? ? ? ? int three = 0 ;

? ? ? ? int three1 = one + two;

? ? ? ? System.out.println("three = one + two ==>" + three1);

? ? ? ? int three2 = three1 += one;

? ? ? ? System.out.println("three += one? ==>" + three2);

? ? ? ? int three3 = three2 -= one;?

? ? ? ? System.out.println("three -= one? ==>" + three3);

? ? ? ? int three4 = three1 *= one;?

? ? ? ? System.out.println("three *= one? ==>" + three4);

three4為什么顯示的是400。three1 *=one應(yīng)該是30*10=300啊。

正在回答

3 回答

因為 three1最后一次賦值是在 three2=three1+=one?

等于 three2=three1=three1+one

由于之前已經(jīng)賦值three1=one+two=10+20=30

所以 three2=three1=three1+one=30+10=40

0 回復(fù) 有任何疑惑可以回復(fù)我~

"int three2 = three1 += one;"此時“three1”已被賦值為40;

"int three4 = three1 *= one; "此時計算為“40*10”。

如果你把“int three3 = three2 -= one; "中"three2"改為"three1"結(jié)果就是300。

0 回復(fù) 有任何疑惑可以回復(fù)我~

我剛把three1改成three2就顯示300了,three2不是40嗎,沒搞懂

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

微笑的火龍果

three2最開始是40,在“ int three3 = three2 -= one; ”中three2又被賦值為30了。
2019-02-24 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

three1是30.three1*=one應(yīng)該是300啊。為什么是400?

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號