喜悦国际村 » JAVA/C/C++ » 怎样改才能改变值

页: [1]
坏鱼儿62003-8-6 03:27 PM
怎样改才能改变值

public class mySwap{
public static void main(String args[]){

int x = 3;
int y = 6;
swap(x,y);
System.out.println("x = "+x);
System.out.println("y = "+y);
}

public static void swap(int x,int y)
{
int Temp;
Temp = x;
x = y;
y = Temp;
}
}

onis_man2003-8-6 05:00 PM
[url]http://www.phpx.com/happy/showthread.php?s=&threadid=34604[/url]


查看完整版本: 怎样改才能改变值


Powered by Discuz! Archiver 6.1.0  © 2001-2006 Comsenz Inc.
Processed in 0.005772 second(s), 2 queries