Java program to find the duplicate words in a stringIn this program, we need to find out the duplicate words present in the string and display those words. Example: big black bug bit a big black dog on his big black nose To find the duplicate words from the string, we first split the string into words. We count the occurrence of each word in the string. If count is greater than 1, it implies that a word is duplicate in the string. ALGORITHM
Program:Output: Duplicate words in a given string : big black Next TopicJava Programs |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India