What does >>> mean in java?

The code may have something like the following. Both ways of writing are the same, the same.

        int a = 2201;
        a >>>= 2;
        Log.d("111333","这是页面   ----------打印a="+a);

        int b = 2201;
        int g=(b>>>2);
        Log.d("111333","这是页面   ----------打印g="+g);

The print log content is
insert image description here

>>>是java中的移位运算符,表示无符号右移,意思就是先将2201转换成二进制100010011001
然后在往右边移动两位数字后变成1000100110,舍弃的01丢弃,在把1000100110转换成十进制就是550
所以打印日志为什么会输出550就是这个原因。 
至于十进制和二进制如何转换自行百度。                                                               

Guess you like

Origin blog.csdn.net/qq_36570506/article/details/130322705