求大神解答一下這個問題,謝謝
Sytem.out.println("three =one +two ==>" + three ); ? ? ? ?three += one ; 有哪位大神幫忙解答下?("three =one + two =>" +three); ? ? ? ?three += one; 難道不能這樣嗎:Sytem.out.println("three =one + two");
Sytem.out.println("three =one +two ==>" + three ); ? ? ? ?three += one ; 有哪位大神幫忙解答下?("three =one + two =>" +three); ? ? ? ?three += one; 難道不能這樣嗎:Sytem.out.println("three =one + two");
2016-04-08
舉報
2016-04-08
"three =one +two ==>"? 這是一個字符串,后面的+three?? three是整型變量;
比如輸出的結果應該是: three =one +two ==>3
這里的10就是,three的數值,這個數值是前面程序中你編寫好的,比如
int one=1;
int two=2;
int three=0;
three=one+two;
.....
Sytem.out.println("three =one +two ==>" + three );?
--------------------------------------------------------------------------------------------------
如果你要寫成Sytem.out.println("three =one + two");
那么輸出的結果為:
three =one + two
這是一串字符!
--------------------------------
至于你后面寫的 three+=one;表示的是個計算== three=three+one; 不清楚你想表達的是什么意思。
2016-04-08
雙引號里的內容會直接輸出,不會運算的
2016-04-08
你再Sytem.out.println的輸出里面寫了雙引號(""),這樣雙引號內的內容就會被當成字符串輸出