package zuoye1;
public class TestCon {
public void swap(int[] count) {
int temp=count[0];
count[0]=count[1];
count[1]=temp;
}
public static void main(String[] args) {
TestCon testCon=new TestCon();
int []a={3,5};
System.out.println("交换前:"+a[0]+"+"+a[1]);
testCon.swap(a);
System.out.println("交换后:"+a[0]+"+"+a[1]);
}
}
参数互换
最新推荐文章于 2023-07-25 19:56:04 发布