Question: 12. Miscellaneous String Operations Write a class with the following static methods: and return the wordcount. This method should accept a String object as an
12. Miscellaneous String Operations Write a class with the following static methods: and return the wordcount. This method should accept a String object as an argument and number of words contained in the object. arrayToString. String object. The method should return a reference to the String object. mostFrequent. This method accepts a String object as an argument and returns the chus This method accepts a char array as an argument and converts it toa acter that occurs most frequently in the object replaceSubstring. This method accepts three String objects as arguments. Let's cll them string1, string2, and string3. It searches string1 for all occurrences of string2 When it finds an occurrence of string2, it replaces it with string3. For example, suppose the three arguments have the following values: string1: "the dog jumped over the fence" string2: "the string3 "that" With these three arguments, the method would return a String object with the value that dog jumped over that fence". Demonstrate each of these methods in a complete program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
