public static void swap(int[] i,int[]j)
     {
        int temp[]=new int[1];
        temp=i;
        i=j;
        j=temp;
     }
试试

解决方案 »

  1.   

    public static void swap(int[] i,int[]j)
         {
            for(int index = 0; index < i.length; index++) {
               int temp = i[index];
               i[index] = j[index];
               j[index] = temp;
            }
         }
      

  2.   

    public static void swap(int[] i,int[]j)
         {
            for(int index = 0; index < i.length; index++) {
               int temp = i[index];
               i[index] = j[index];
               j[index] = temp;
            }
         }
      

  3.   

    谢谢,行了,helpall解释一下好吗,我得为什么不行
      

  4.   

    i和a指向同一个数组X,j和b指向同一个数组Y. 你的方法又让i和j指向新的数组,就没有用了.
    fcpanda()的方法让i指向数组Y,j指向数组X,但外部的a和b是不会变的.