@@ -0,0 +1,308 @@
+public class CountX %7B%0A  public static void main (String... args) %7B%0A    // Result: 0%0A    System.out.println(new CountX().countX(%22hi%22));%0A  %7D%0A%0A  public int countX(String str) %7B%0A    return str.equals(%22%22)?0:(str.charAt(0)=='x'?1+countX(str.substring(1,str.length())):countX(str.substring(1,str.length())));%0A  %7D%0A%7D%0A

Create CountX.java