// Store the formatted string in 'result' String result = String.format("%4d", i * j); // Write the result to standard output System.out.println( result );