本帖最后由 邱成 于 2012-9-23 00:29 编辑
public class Demo2 {
public static void main(String []args){
fangfa1(3,7);
fangfa2(3,7);
}
public static void fangfa1(int m,int n){
int temp;
temp=m;
m=n;
n=temp;
System.out.println(m);//输出7
System.out.println(n);//输出3
}
public static void fangfa2(int m,int n){
m=m^n;
n=m^n;
m=m^n;
System.out.println(m);//输出7
System.out.println(n);//输出3
}
}
|