//: holding/UniqueWordsAlphabetic.java // Producing an alphabetic listing. import java.util.*; import net.mindview.util.*; public class UniqueWordsAlphabetic { public static void main(String[] args) { Set words = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); words.addAll( new TextFile("SetOperations.java", "\\W+")); System.out.println(words); } } /* Output: [A, add, addAll, added, args, B, C, class, Collections, contains, containsAll, D, E, F, false, from, G, H, HashSet, holding, I, import, in, J, java, K, L, M, main, mindview, N, net, new, Output, Print, public, remove, removeAll, removed, Set, set1, set2, SetOperations, split, static, String, to, true, util, void, X, Y, Z] *///:~