I am trying to convert this 2d char array to a String. The issue is it is outputting 100,000 characters even through the input array is no where near that. What is the correct way to convert a 2d char array to a string?
public String printMaze(char[][] maze) {
String s= "";
for(int i=0;i<maze.length;i++){
for(int j=0; i<maze[i].length;j++){
s= maze.toString();;
}
}
return s;
}
maze.toString(), how do you want to join the characters? Because you could doreturn Arrays.deepToString(maze);