代码
// 变量交换演练标签:230211,java,变量,int,练习,交换,System,println,out From: https://blog.51cto.com/u_13137233/6050903
int a = 2;
int b = 7;
// 方案一
// int c = a;
// a = b;
// b = c;
// System.out.println(a);
// System.out.println(b);
// 方案二
a = a + b;
b = a - b;
a = a - b;
System.out.println(a);
System.out.println(b);