I tried some code to swap two integers in Java without using a 3rd variable, using XOR.
Here are the two swap functions I tried:
package lang.numeric
Second variant is equal to
a=a^(b^(a^b));