Possible Duplicate:
^ operator in java
I was assuming that c ^ d is a calculation like ‘the power of’, so c = 5, d = 2, result is 25. I think I’m wrong, though.
Can you explain what (c ^ d) does in java, for example in
result = result + (char)(c ^ d)
^is the bitwise xor meaning that0b0101^0b0010(5^2) is0b0111and0b0101^0b0111is0b0010look at the truth table of xor (the result is 1 if the input are different
the bitwise operators take each bit of the terms and apply the operator to each bit