引用类型:数组,类(class),接口(interfac)
我使用了数组
public class TestCon {
public void swap(int[] count) {
// TODO Auto-generated method stub
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]);
}
}