print unique words in java alphabetical order code example Example: Create a 'uniqueWords' function that accepts a string 'str' and returns an array of all the unique words in that string. str = unique(str)