【发布时间】:2015-02-07 20:36:26
【问题描述】:
public static int Obstacle[][] = {{1, 3}, {2, 2}};
public static boolean testerFunction(int j, int k) {
int check[] = {j, k};
if (Arrays.asList(Obstacle).contains(check)) {
return true;
}
else {
return false;
}
}
我有这个代码。
它总是返回 false,尽管检查等于 {1,3} 或 {2,2}
我的代码有什么问题? Java中如何检查数组是否存在于数组数组中?
【问题讨论】: