^ operator in java [duplicate]

Solution 1:

This is the same as ^ in most languages, just an XOR.

false ^ false == false
true ^ false == true
false ^ true == true
true ^ true == false 

Solution 2:

Some of the other answers only say it is a bitwise XOR, but note that it can also be a logical XOR if the operands are of boolean type, according to this source.