我試圖將我的char數組grid1傳遞給稱爲狀態的方法。我收到錯誤字符不能轉換爲char [] []。我將如何傳遞grid1,以便在for循環中工作?將CharArray傳遞給方法
for (int row = 0; row < 30; row++){
for (int col = 0; col < 30; col ++){
if (status(grid1[row][col], row, col)){
}
}
}
public boolean status(char [][] grid, int a, int b){
char value = grid[a][b];
if (value == 'X'){
//add X to another array
return true;
} else {
return false;
}
//add - to another array
}