最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

不能理解,為什么three在下一行的值會變成上一行的值

package com.wolike;


public class 試題8賦值運算符 {

public static void main(String[] args){

int one=10;

int two=20;

int three=30;

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

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

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

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

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

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

}


}

最后輸出的是:

three=one+two==>30

three+=one==>40

three*=one==>300

three/=one==>3

three-=one==>20

three%=one==>0


正在回答

4 回答

你這three的賦值是30,源代碼中是0,另外你的代碼沒有將three重新賦值,所以three始終是30,并沒有像你說的那樣“下一行的值會變成上一行的值”。

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

因為你發(fā)的代碼沒有將three重新賦值,所以你的運算結(jié)果永遠是用one和two這兩個變量進行計算,計算結(jié)果肯定跟任務(wù)中要求的結(jié)果不一樣。

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

多去看看2-4的課。就能理解

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

不好意思,發(fā)錯了


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

舉報

0/150
提交
取消

不能理解,為什么three在下一行的值會變成上一行的值

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

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

幫助反饋 APP下載

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

公眾號

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