Arithmetic shift right-logical shift right

In java

The operator >> indicates that the arithmetic shifts to the right , that is, when the right shifts, the left vacant bits are filled with 0 or 1 depending on the sign

The operator >>> means logical right shift , that is, the left vacant bits are filled with 0 when shifting to the right .

The operator << indicates that the arithmetic shifts to the left or logically to the left, that is, when the left shifts, the vacated bits are filled with 0.

copy Description of the median operator in a rookie tutorial

 This is actually very simple, but I always forget it and record it.

 

Guess you like

Origin www.cnblogs.com/lyw-hunnu/p/12761329.html