What kind of error would the method call myMethod("Frog") cause?

public void myMethod(String x)
{
for(int i = 0; i <= x.length(); i++)
{
System.out.println(x.substring(i, i+1));
}
}

Compile Time Error: Missing return value


Runtime Error: String index out of range


Compile Time Error: Unexpected return value


Compile Time Error: Syntax Error in method definition

Respuesta :

Answer:

Runtime Error: String index out of range.

Explanation:

I could be wrong but If I remember my computer programming class correctly this should be a runtime error.