I am trying to delete all the same data in an 2D array; for example;
0 1 3 4 1 4
0 2 3 4 2 1
0 2 3 2 2 1
if the user types the coordinate as (0,1)
;
all the data that equals to 0
should be null
;
However, my code will just the delete the data which I typed in.
int a =Integer.valueOf(scan.next());
int b= Integer.valueOf(scan.next());
for(int i=0;i<rows;i++){
for (int j=0;j<clos;j++){
if(BubbleWordl.world[i][j]==BubbleWorld.world[a][b]){
BubbleWorld.world[i][j]=null;
}
}
}