I want to swap the value of two integer variables in java using the XOR operator.
This is my code:
int i = 24; int j = 17; i ^= j; j ^= i; i ^= j;
How about doing: i ^= j ^ (j = j ^ i ^ j);