参见英文答案 > Difference between >>> and >> 7个
我没有Java参考书,我很难找到谷歌的答案.
“>>”之间的区别是什么?和“>>>” Java中的运算符?
int value = 0x0100;
int result = (value >> 8);
System.out.println("(value >> 8) = " + result); // Prints: "(value >> 8) = 1"
result = (value >>> 8);
System.out.println("(value >>> 8) = " + result); // Prints: "(value >>> 8) = 1"
解决方法:
>>>是logical shift,>>是arithmetic shift.