1for ( int i = 0; i < rows; i++) { //for each row
2 String row = Arrays.toString(matrix[i])
3 .replace(",", "") //remove the commas
4 .replace("[", "") //remove the left bracket
5 .replace("]", "") //remove the right bracket
6 .trim(); //remove trailing spaces from partially initialized arrays
7 System.out.println(row);
8}
9
10