标签:
1 public class Test{ 2 public static void main(String[] args){ 3 int a = 1; 4 int b = 2; 5 // 请交换两个变量的值 6 } 7 }
1 public class Test{ 2 public static void main(String[] args){ 3 int a = 1; 4 int b = 2; 5 // 请交换两个变量的值 6 a=a+b; 7 b=a–b; 8 a=a–b; 9 } 10 }
1 public class Test{ 2 public static void main(String[] args){ 3 int a = 1; 4 int b = 2; 5 // 请交换两个变量的值 6 a^=b; 7 b^=a; 8 a^=b; 9 } 10 }
标签:
原文地址:http://www.cnblogs.com/brainit/p/5528599.html