lifei1461
发贴: 1
积分: 0
|
于 2005-05-15 00:23
public class AssignTest { public long[][] time = null; public AssignTest() { time = new long[4][5]; }
public void setArray(long[][] a) { //a = new long[2][3]; for (int i = 0; i < a.length; i++) { for (int j = 0; j <a[i].length; j++) { a[i][j] = (i+1) * (j+1); // System.out.println(a[i][j]); //System.out.println(time1[i][j]); } } }
public void printArray() {
setArray(this.time);//通过这个函数对成员变量进行赋值 for (int i = 0; i < time.length; i++) { for (int j = 0; j < time[i].length; j++) { System.out.println(time[i][j]); } } }
public static void main(String[] args) { AssignTest at = new AssignTest(); at.printArray(); } }
这程序怎么不是pass-by-value??? 输出结果是 1 2 3 2 4 6
|