I have a 2-d array which contains objects.does anyone knows how can i print this array?Because when i use the following code doesn’t print the contain of the object but print symbols.
Humans [][]cells= new Humans [7][7];
for (int row=0; row<cells.length; row++) {
for (int col=0; col<cells[row].length; col++) {
System.out.print(" " + cells[row][col]);
}
}
You need to add a toString() to your Humans object if you want to include it in string concatenation.