Java的>>与>>>运算符?

内特:

我没有Java参考书,也很难在Google上找到答案。

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"
Budric:

>>>逻辑位移>>算术位移

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章