什么>>和>>>用Java表示? [英] What does >> and >>> mean in Java?
本文介绍了什么>>和>>>用Java表示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
>> ;
和>>>
是指Java?
为什么 -1>> 2
和 -1>>> 2
有不同的结果?
Why does -1 >> 2
and -1 >>> 2
have different results?
推荐答案
>>
是一个带符号的右移运算符,它将位模式向右移位。
>>>
是一个无符号右移运算符,它将零移动到最左边的位置。请参阅 Oracle Docs。
>>
is a signed right shift operator which shifts a bit pattern to the right.
>>>
is an unsigned right shift operator which shifts a zero into the leftmost position. Please refer to the Oracle Docs.
这篇关于什么>>和>>>用Java表示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文