Question: Q 1 . Write a Java program that prompts the user to input a file name, then your program should read the file and find
Q Write a Java program that prompts the user to input a file name, then your program should
read the file and find all the unique words in the file. Your program should print the list of the
unique words to the standard output, and it should also write the list of the unique words to a
file. In your output file, you should write each word in a separate line.
Make sure your program handles exceptions: file not found and IO exceptions,
If the user entered a file that doesn't exist, your program should print a message, then
terminate.
For example, if the file content is:
"java is a high level language that was released in Java is an objectoriented language"
Then, you output should be:
java
is
a
high
level
language
that
was
released
in
an
objectoriented
Note that repeated words are not printed
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
