I have the following code:
public boolean prontoParaJogar() throws RemoteException { int i; int j; if (this.jogadores==2) { this.jogando=1; for (i=0;i<3;i++) for(j=0;j<3;j++) { this.tabuleiro[i][j]=0; } for (i=0;i<3;i++) { System.out.println("Linha "+i+": "); System.out.print(this.tabuleiro[i][0]+' '); System.out.print(this.tabuleiro[i][1]+' '); System.out.print(this.tabuleiro[i][2]); System.out.println(""); } return true; } else { return false; } }
it prints the following output:
Linha 0:
32320
Linha 1:
32320
Linha 2:
32320
Linha 0:
32320
Linha 1:
32320
Linha 2:
32320
This is not what I expected. This should be the following output:
Linha 0:
0 0 0
Linha 1:
0 0 0
Linha 2:
0 0 0
I can’t understand why it is not working as expected.
source share