public static String printArray ( int [ ] array ) { String result = "[" ; for ( int i = 0 ; i < array . length ; i ++ ) { result += array [ i ] ; result += ( i < ( array . length - 1 ) ) ? ", " : "" ; } result += "]" ; return result ; }
Pretty prints an array of ints as a string .