对象的引用就是用对象去调用一个方法数组实现数值交换能够实现以int型数组为例public void swap(int[] a, int i, int j) { int temp=a[i]; a[i]=a[j]; a[j]=temp; }