What will be the output of the following program?
public class Recurssions {
public int result(String input) {
if (input == null || input.length() == 0) {
return 0;
}
return result(input, 0);
}
public int result(String input, int count) {
if (input.length() == 0) {
return count;
}
if (input.substring(0, 1).equalsIgnoreCase("K")) {
count = count + 1;
}
return result(input.substring(1), count);
}
public static void main(String[] args) {
System.out.println("Output is = " + new Recurssions().result("Kakakatiya....yaKata"));
}
}