課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)升級版
30 40 30 300 30 10
2018-05-09
源自:Java入門第一季(IDEA工具)升級版 3-3
正在回答
位與運算符(&)
運算規(guī)則:兩個數(shù)都轉(zhuǎn)為二進制,然后從高位開始比較,如果兩個數(shù)都為1則為1,否則為0。
比如:10&30.
10轉(zhuǎn)換成二進制就是01010,30轉(zhuǎn)換成二進制就是11110。從高位開始比較得到,得到01010,即10.
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=0;???????? ???????????three+=one;???????? ???????????System.out.println(three);???????? ???????????//three=0;???????? ???????????three-=one;???????? ???????????System.out.println(three);???????????????? ???????????//three=0;???????? ???????????three*=one;???????? ???????????System.out.println(three);???????????????? ???????????//three=0;???????? ???????????three/=one;???????? ???????????System.out.println(three);???????????????? ???????????//three=0;???????? ???????????three?&=one;???????? ???????????System.out.println(three);??????????????????? ???????????} ??}
厲害的一個一個敲空格,這排版跟shi一樣
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=0;????????three+=one;????????System.out.println(three);????????//three=0;????????three-=one;????????System.out.println(three);????????????????//three=0;????????three*=one;????????System.out.println(three);????????????????//three=0;????????three/=one;????????System.out.println(three);????????????????//three=0;????????three?&=one;????????System.out.println(three);??????????????????? }}
代碼如下
舉報
0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語法開始
3 回答最后的這一行代碼輸出為什么錯誤,為什么不能輸出變量i
2 回答輸出結(jié)果一樣,顯示輸出錯誤
6 回答輸出錯誤?
3 回答輸出錯誤???
1 回答為什么最后一行是錯誤的
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-05-09
位與運算符(&)
運算規(guī)則:兩個數(shù)都轉(zhuǎn)為二進制,然后從高位開始比較,如果兩個數(shù)都為1則為1,否則為0。
比如:10&30.
10轉(zhuǎn)換成二進制就是01010,30轉(zhuǎn)換成二進制就是11110。從高位開始比較得到,得到01010,即10.
2018-05-09
厲害的一個一個敲空格,這排版跟shi一樣
2018-05-09
代碼如下