Menu

[Solved]Java Convert Recursive Method Static Int Countst String Str String St Int Index 0 Int Coun Q37224221

Java

Convert this into a recursive method

static int countSt(String str, String st) { int index = 0; int count = 0; while(index <= str.length()-st.length()) { if (str.substring(index,index+st.length()).equals(st)) { count++; } index++; } System.out.println( count + ” ” + st + ” in “+ str ); return count; }

Expert Answer


Answer to Java Convert this into a recursive method static int countSt(String str, String st) { int index = 0; int count = 0; whil… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *