posted 17 years ago
Hello all, I'm coding something like
for(int i = 0; i < maze.length; i++)
{
for(int x = 0; x < maze[0].length; x++)
{
if(maze[i][x] == ('.'))
{
maze[i][x] == ('!');
}
System.out.print(maze[i][x]);
}
that finds a '.' char in a 2D array and replaces it with a '!' character. However, using == does not work. I have tried using .equals as well and get a dereferencing error. Any help on how to compare the characters would be greatly appreciated, thanks.