operands, regardless of type, are stored in binary form in memory, such as 255 of the type "Byte" is stored in memory as "1111111111", and the number 4 of the "short" type is stored in memory in the form of "000000000000100". The binary operation is the operation of these binary numbers, binary operations are widely used, such as the network subnet mask algorithm is to use binary operation.
The following table lists the basic operators for binary operations
Operator |
Name |
Type |
Description |
Bitand |
Bitwise AND |
Binocular operator |
o bitand o value is O o Bitand 1 value is O 1 Bitand o value is O 1 Bitand 1 value is 1 |
Bitnot |
Bitwise NON |
Monocular operator |
Bitnot o value is 1 Bitnot 1 value is 0 |
Bitor |
by bit or |
Binocular operator |
o bitor o value is O o Bitor 1 value is 1 1 Bitor o value is 1 1 Bitor 1 value is 1 |
Bitxor |
Per-bitwise XOR OR |
Binocular operator |
o bitxor o for O O Bitxor 1 to 1 1 Bitxor o to 1 1 Bitxor 1 to 1 |