@@ -0,0 +1,334 @@
+public class StrCount %7B%0A  public static void main (String args%5B%5D) %7B%0A    // Result: 2.%0A    System.out.println (new StrCount ().strCount (%22catcowcat%22, %22cat%22));%0A  %7D%0A  %0A  public int strCount(String str, String sub) %7B%0A    return str.equals (%22%22)%7C%7C!str.contains (sub)?0:1+strCount (str.substring (str.indexOf (sub)+sub.length()),sub);%0A  %7D%0A%7D%0A

Create StrCount.java