The array is valid and sorted print the strings in order
for ( int i = 0 ; i < maxLen ; i ++ ) { String s = sortedArr [ i ] ; for ( int j = 0 ; j < count [ i ] ; j ++ ) { System . out . println ( s ) ; } } }