我有一个二维的ArrayList(我希望它的ArrayList)由比较字符串
String table[][];
table = new String[7][7];
我加了一些字符串定义,然后我试图通过
int c = 0;
int v = 0;
for (int s = 0; s < 49; s++) {
if (s != 0) {
c++;
}
if (c == 6) {
v++;
c -= 6;
}
boolean check = table[c][v].equals("highlited");
if (check) {
System.out.println("got one");
}
}
,但我找对象程序不起作用,有什么想法? 对于我所犯的所有错误,我很抱歉,我是编程世界中的新人。
您在所包含的代码中没有ArrayList对象。他们都是阵列。 –
为什么不使用两个嵌套循环,每个循环都从0到6,并检查数组中的每个位置? –
你如何设置数组中的字符串? –