I don't know what you mean witth "arithmetic operators". I think they're relational operators between the boxes.
Below is a code that puts the relational operators between the columns. The code that does the same between the rows is missing.
public void printPuzzle() {
// ---------------------------------------------------------------
// print the grid
// ---------------------------------------------------------------
for (int i = 0; i < grid.length; i++) {
// -----------------------------------------------------------
// print a row
// -----------------------------------------------------------
// -----------------------------------------------------------
// lines above the boxes
// -----------------------------------------------------------
System.out.println(" +---+ +---+ +---+ +---+ +---+ ");
// -----------------------------------------------------------
// print each box in the row
// -----------------------------------------------------------
for (int j = 0; j < grid.length; j++) {
// ----------------------------------------------
// get row constrain
// ----------------------------------------------
String rowConstraint = " ";
if (j < grid.length - 1) {
rowConstraint = rowConstraints[ i ][ j ];
}
// ----------------------------------------------
// print a box an it's row constraint
// ----------------------------------------------
System.out.print(" | " + grid[i][j] + " | " + rowConstraint );
}
System.out.println();
// -----------------------------------------------------------
// -----------------------------------------------------------
// lines below the boxes
// -----------------------------------------------------------
System.out.println(" +---+ +---+ +---+ +---+ +---+ ");
// -----------------------------------------------------------
// an empty row to separate boxes vertically
// -----------------------------------------------------------
System.out.println();
}
}