小编ste*_*816的帖子

如何检查char数组是否有空单元格,以便在其中打印0?

码:

public void placeO(int xpos, int ypos) {
    for(int i=0; i<3;i++)
        for(int j = 0;j<3;j++) {
            // The line below does not work. what can I use to replace this?
            if(position[i][j]==' ') {
                position[i][j]='0';
            }
        }
}
Run Code Online (Sandbox Code Playgroud)

java loops compare char charat

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

char ×1

charat ×1

compare ×1

java ×1

loops ×1