Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the user).
Requirements:
- You will need to create a class called Word that contains the methods to process the frequency of the words.
- A main method to run the other methods from the class Word.
[Create a text file containing the speech of Martin Luther King Jr. (I Have a Dream) to test your program].