向方法中传递数组。

public static void main(Strign [] args){

  int [] arr = {3,6,9}; //使用静态初始化定义数组

  fun(arr);   //传递数组引用

  for(int i = 0; i < arr.length; i++){  //循环输出

    syso(arr[i]);

  }

}

public static void fun(int[] x){   //接收整型数组引用

  x[0] = 88;

}

原文地址:https://www.cnblogs.com/wangffeng293/p/13260689.html