bit shift - What is the difference between operator >> and operator >>> in java? -


i used use >> operator right shifting. i've replaced >>> , found same result. can't figure out whether these 2 fundamentally equal or not.

the first operator sign-extends value, shifting in copy of sign bit; second 1 shifts in zero.

the reason emulate unsigned integers purpose of doing bit operations, partially compensating lack of unsigned integral types in java.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -