>>: Signed right shift. Positive numbers are shifted to the right and the high bits are filled with 0, and negative numbers are shifted to the right and the high bits are filled with 1s. For example:
4 >> 1, the result is 2; -4 >> 1, the result is -2. -2 >> 1, the result is -1.
>>>: Unsigned right shift. Regardless of whether it is a positive or negative number, the high bits are always filled with 0. (Recommended learning: java course)
For positive numbers, there is no difference between >> and >>>.
For negative numbers, -2 >>> 1, the result is 2147483647 (Integer.MAX_VALUE), -1 >>> 1, the result is 2147483647 (Integer.MAX_VALUE) ).
The following code can determine whether the signs of two numbers are equal
return ((a >> 31) ^ (b >> 31)) == 0;
For example:
-12 >> 3 is a signed right shift of 3 digits. The result is: 1111 1111 1111 1111 1111 1111 1111 1110. The decimal system is: -2;
-12 > Zero is: 0001 1111 1111 1111 1111 1111 1111 1110, in decimal: 536870910.
The above is the detailed content of The difference between java >>> and >>. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor