Basically I am trying to create an object and calling it via the main method/ a constructor. When I print it out I get a list but I needed it printed out like a table. Here is the code:
import java.util.Arrays;
public class test2 {
public static String[][] makeTable(int mouseLocationRow, int mouseLocationColumn) {
int rows = 12;
int columns = 12;
String[][] a = new String[rows][columns];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
a[i][j] = "#";
}
}
a[mouseLocationRow][mouseLocationColumn] = "&";
return a;
}
public static void main(String[] args) {
int a = 5;
int b = 5;
System.out.println(Arrays.deepToString(makeTable(a, b)));
}
}
Here is the output:
[[#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, &, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #], [#, #, #, #, #, #, #, #, #, #, #, #]]
Here is how its supposed to look like:
############
############
############
############
############
#####&######
############
############
############
############
############
############
How do I make my output look like how its supposed to look like?