question: public void print ( PrintWriter output , NumberFormat format , int width ) { output . println ( ) ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { String s = format . format ( A [ i ] [ j ] ) ; int padding = Math . max ( 1 , width - s . length ( ) ) ; for ( int k = 0 ; k < padding ; k ++ ) output . print ( ' ' ) ; output . print ( s ) ; } output . println ( ) ; } output . println ( ) ; }
target:  Print the matrix to the output stream.  Line the elements up in columns. Use the format object, and right justify within columns of width characters. Note that is the matrix is to be read back in, you probably will want to use a NumberFormat that is set to US Locale.