我试图从call()返回一个2d数组,我遇到了一些问题。到目前为止我的代码是:如何从Callable返回对象()
//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从哪里来? – 2011-04-01 16:50:32
我很确定'answer = multiplyArray(Array1,Array2,length,);''因为有一个额外的''''不会编译。你应该发布更多的代码,因为我不认为有可能在没有猜测的情况下做出假设。 – 2011-04-01 16:52:40
什么是调用call()方法? – dontocsata 2011-04-01 16:53:29