In Java :
> represents greater than, for example: if (a>b) ... The result is a Boolean type
>> to move right, such as: int i=15; The result of the I>>2 is 3, and the removed part will be discarded.
The conversion to binary may be better understood, 0000 1111 (15) The result of the right shift 2 bits is 0000 0011 (3), 0001 1010 (18) The result of the right shift 3 bits is 0000 0011 (3).
I'm not very clear about what >>> is called, but I know what it means:
The results of J>>>i and j/(int) (Math.pow (2,i)) are the same, where I and J are shaped.
The test code is as follows:
- Public class Test
- {
- Public static void Main (string[] args)
- {
- System.out.println ("1, the following test;:");
- int a = 1, b = 2;
- System.out.println (a > B);
- System.out.println ("\n2, the following test >>:");
- System.out.println (">> 2 =" + (>> 2));
- System.out.println ("\n3, the following test >>>:");
- for (int i = 0; i < ; i++)
- {
- for (int j = 0; j < k ; j = j + 5)
- {
- System.out.println (J/(int) (Math.pow (2, I)));
- System.out.println (J >>> i);
- }
- }
- }
- }
Meaning of >, >>, >>> in Java