Consider the following code:

public void stringRecur(String s) {
  if(s.length() < 15)
    System.out.println(s);     
  stringRecur(s + "*");
}

When will method stringRecur terminate without error?

It never works. It calls itself for any input and goes into an infinite loop.
  • Only when the length of the input string is greater than or equal to 15.
  • Only when an empty string is input.
  • For all string inputs.
  • Only when the length of the input string is less than 15.

Does triggering the "if" statement affect whether a recursive call is made?