I'm having a problem with my 2 dimensional boolean array. (or it may be with the logic of printing out the values). I set all of the values in the array to false in the beginning, and then later i print out the values to the screen. When i print them out, they all come up as true.
x=20; y=10; boolArray = new boolean[x][y]; for(int c=0;c<x;c++) { for(int i=0;i<y;i++) { boolArray[c][i] = false; } } System.out.println("2D Boolean Array:"); for(int a = 0; a < boolArray.length; a++) { for(int b = 0; b < boolArray[a].length; b++) { if(boolArray[a][b] = true) { System.out.print("T"); } else if(boolArray[a][b] = false) { System.out.print("F"); } } }
xandy? post full code=in yourifconditions, not==