Create a class Recursion. It will have two static methods: removeX and countSubstring and write each function recursively. Recursion class removeX The removeX function will take a String as a parameter. It will return a new String that is the same as the original String, but with all “x” characters removed. This method will be case insensitive. countSubstring The countSubstring function will take two strings as parameters and will return an integer that is the count of how many times the substring (the second parameter) appears in the first string without overlapping with itself. This method will be case insensitive. For example: countSubstring(“catwoman loves cats”, “cat”) would return 2 countSubstring(“aaa nice”, “aa”) would return 1 because “aa” only appears once without overlapping itself. Create a Main class to test and run your Recursion class.
Create a class Recursion. It will have two static methods: removeX and countSubstring and write each function recursively.
Recursion class
removeX
The removeX function will take a String as a parameter. It will return a new String that is the same as the original String, but with all “x” characters removed. This method will be case insensitive.
countSubstring
The countSubstring function will take two strings as parameters and will return an integer that is the count of how many times the substring (the second parameter) appears in the first string without overlapping with itself. This method will be case insensitive.
For example:
countSubstring(“catwoman loves cats”, “cat”) would return 2
countSubstring(“aaa nice”, “aa”) would return 1 because “aa” only appears once without overlapping itself.
Create a Main class to test and run your Recursion class.

Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images









