?? rightshifttest.java
字號:
// operators/RightShiftTest.java
// TIJ4 Chapter Operators, Exercise 11, page 116
/* Start with a number that has a binary one in the most significant position
* (hint: Use a hexadecimal constant). Using the signed right-shift operator,
* right shift it all the way through all of its binary positions each time
* displaying the result using Integer.toBinaryString().
*/
import org.greggordon.tools.*;
public class RightShiftTest {
public static void main(String [] args) {
int h = 0x10000000;
P.rintln(Integer.toBinaryString(h));
for(int i = 0; i < 28; i++) {
h >>>= 1;
P.rintln(Integer.toBinaryString(h));
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -