Question: Write a Java program that calculates the number of duplicate words in a sentence. You may assume that the input consists only 52 English characters
Write a Java program that calculates the number of duplicate words in a sentence. You may assume that the input consists only 52 English characters with a single white-space as the separator between words (not punctuations in the inputted sentence). You need consider uppercase and lowercase letters the same. You may get the input from the keyboard. (You need to use Set and/or Hashset). The output should look like the followingthe number of the duplicates and the unique words for that input sentence: 
Please enter a sentence: I am Happy i was happy There are 2 words that are duplicates. The unique words are: [was, i, happy, am]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
