Just looking at the PHP basics in Imooc to find a particularly easy-to-understand description of "about XOR or operation."
There were 4 ways to learn Java before, and it was recorded like this:
& The Bitwise AND (and) two correspond to the binary are 1 is 1, the remainder is all 0
| The bitwise OR (or) two binary number has one of 1 is 1, only two 0 is 0
~ Bitwise non (not) binary to negate
^ Bitwise XOR (XOR) two binary is the same as 0, the difference is 1 in fact, the most difficult to understand is this XOR operation.
Move directly to (the original URL point i):
We can understand the logical operation from the perspective of voting:
1, logic and: require everyone to vote for consent, will pass an agreement;
2, logic or: only ask a person to vote to agree on the line;
3. Logical XOR : only one person can vote for consent;
4, logic is not: a person to oppose, but through the logic of non-, so that its objection invalid;
Bit operations in Java