The following code
System.out.println(\"1 0 0: \" + (true ^ false ^ false));
System.out.println(\"1 0 1: \" + (true ^ false ^ true));
System.out.println(\"1 1 0:
I don't know is it discovered and highlighted, but I noticed a thing that if we add all values together (no matter how many are there) and see what's left after division by 2 we can notice the result is false
if 0
left and true
if 1
left.
Example:
1 ^ 0 ^ 1 ^ 1 = 1
and
(1+0+1+1)%2 = 1
They are the same. Please, correct or guide me who has a clue about this case.