1. 使用加减法
int x = 3; int y = 5; x = x ^ y; y = x ^ y; x = x ^ y;
2. 使用异或
int x = 3; int y = 5; x = x + y; y = x - y; x = x - y;
3. 只要在int范围内都没有问题
int x = Integer.MAX_VALUE; int y = Integer.MAX_VALUE - 15; x = x + y; y = x - y; x = x - y;