@@ -0,0 +1,299 @@
+public class CountHi %7B%0A  public static void main (String args%5B%5D) %7B%0A    // Result:4%0A    System.out.println(new CountHi().countHi (%22xxxhihihixxxhi%22));%0A  %7D%0A  %0A  public int countHi (String str) %7B%0A    return (str.equals(%22%22)%7C%7Cstr.indexOf(%22hi%22)==-1)?0:1+countHi (str.substring(str.indexOf(%22hi%22)+2));%0A  %7D%0A%7D%0A

Create CountHi.java