Result string ordering

exercise No. 183

A text's set of words in alphabetic order Create comment in forum

Q:

Copy the previous project to a second one and modify your code to get the same set of words but in alphabetic order with respect to capital and small letters:

A, Some, appear, collection, may, multiple, of, simple, times, words

A:

The desired result is easy to achieve by exchanging our Set by a SortedSet:

/**
 * The set of words found so far.
 */
final SortedSet<String> words = new TreeSet<String>();