举例代码:
1.public class Console {
2. public static void main(String[] args) {
3. int i = 88 >> 32;
4. long l = 67 >> 64;
5. System.out.println("the i is : " + i);
6. System.out.println("the l is : " + l);
7. }
8.}
输出:
the i is : 88
the l is : 67
从输出可以看出,两数没有变,因为移位前,Java首先把要移的位数和被移树的位数求余数,然后移动余数个位数,在本例中求余数为0,没有造成移动。
谢老师QQ:544627560
疯狂软件官网:http://www.fkjava.org
疯狂java视频android视频http://www.fkjava.org/video/index.htm
|
|