The >> operator in Java is the right shift operator. It shifts the bits of a number to the right by a specified number of positions. For each shift, the least significant bit (rightmost bit) is discarded, and the most significant bit (leftmost bit) is filled based on the sign of the original number (0 for positive numbers and 1 for negative numbers).
For example:
int num = 8; // Binary: 0000 1000
int result = num >> 2; // Shifts bits to the right by 2 positions
// result will be 2 (Binary: 0000 0010)
In this example, the binary representation of 8 is shifted right by 2 positions, resulting in 2.
