Shift operators in Java: <, > >, > > > summary

There are three shift operators in Java

< <: shift left operator, Num < < 1, equivalent to num multiplied by 2

>>: shift right operator, Num > > 1, which is equivalent to num divided by 2

>>>: move unsigned right, ignore the sign bit, and fill up the empty bits with 0

Let's see how these shift operations are used

The operation result is:

Let's align the above results:

After reading the above demo, do you know a lot about shift left and shift right now

For: > > >

Move unsigned right, ignore the sign bit, and fill up the empty bits with 0

Value > > > num -- num specifies the number of bits to shift the value value.

The rule of unsigned right shift only remembers one thing: the symbolic bit extension is ignored, and the unsigned right shift operator of 0 complementing the highest bit > > > is only meaningful for 32-bit and 64 bit values

========================================================

More reading,and english is important.

I'm Hongten

大哥哥大姐姐,觉得有用打赏点哦!多多少少没关系,一分也是对我的支持和鼓励。谢谢。Hongten博客排名在100名以内。粉丝过千。Hongten出品,必是精品。

E | hongtenzone@foxmail.com B |

========================================================

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>