I have a problem with the use of the '>>' character, I would like to know what function it actually fulfills, what it does, taking into account something like:
System.out.println(5>>1);
the result is 2 but why? I understand that it is also called the Bits operator but it really compares the bits of these numbers and determines what?
To know why, you have to pass the number 5 to binary:
00000101
The operator
>>
shiftsX bits
to the right depending on the number after the operator, in your case1 bit
, so00000101 -> 00000010
what is2