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:
Think about how the compiler evaluates this:
(true ^ true) ^ true
After first term true ^ true, which is false, has been evaluated:
true ^ true
false
(false) ^ true ==> true