【发布时间】:2011-07-27 20:19:21
【问题描述】:
我正在尝试从 call() 返回一个二维数组,但遇到了一些问题。到目前为止我的代码是:
//this is the end of main
Thread t1 = new Thread(new ArrayMultiplication(Array1, Array2, length));
t1.start();
}
public int[][] call(int[][] answer)
{
int[][] answer = new int[length][length];
answer = multiplyArray(Array1, Array2, length); //off to another function which returns the answer to here
return answer;
}
此代码编译,这不返回我的数组。我确定我可能使用了错误的语法,但我找不到任何好的示例。
编辑:稍作改动
【问题讨论】:
-
返回什么?长度从何而来? Array1 和 Array2 来自哪里?
-
我很确定
answer = multiplyArray(Array1, Array2, length,);不会编译,因为有一个额外的,。您应该发布更多代码,因为我认为不可能在没有猜测的情况下在这里做出假设。 -
什么是调用 call() 方法?
标签: java multithreading callable