Java Write a recursive method that finds the number of occurrences of a specified letter in a string using the following method header: public static int count(String str, char a) For example, count(\"welcome\",\' e\') returns 2. Write a test program that prompts the user to enter a string and a character, and displays the number of occurrences for the character in the string. Solution Program: import java.util.Scanner; public class CountingOccurences //here class name is CountingOccurences { public static void main(String[] args) { Scanner input = new Scanner(System.in);// scnning input from the key board System.out.print(\"Enter a string:\");// Ask the user to Enter string String s1 = input.nextLine();//Here we naming entire string as s1 System.out.print(\"Enter a charecter:\");// Ask the user to Enter Character char ch = input.nextLine().charAt(0);//user input character is named as ch System.out.println(\"the number of \" + ch + \" in the string is \"+ count(s1, ch));//printing no of times the character is in the given string } public static int count(String str, char a) //we are taking paramaters as String and char in count method { int count = 0; //initializing count value to zero for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == a) // if the enter cahacter is found in a given string the count value is incremented count++; } return count;//returns the count value } } Output: Enter a string:hello Enter a charecter:l the number of l in the string is 2 .