Question: * 04: [15 marks] * implement count method in Q4 class. It is a recursive method that finds the number of occurrences of a specified

* 04: [15 marks] * implement count method in Q4 class. It is a recursive method that finds the number of occurrences of a specified letter in a string. * For example, count("Welcome", 'e') returns 2. * NOTE: Note that writing a non-recursive method will lead to a point. ********/ System.out.println("Q4 = [15 marks] System.out.println(Q4.count("Welcome", 'e')); class 04 { public static int count(String str, char c){ //TODO return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
