Hi there. Per the java spec, since you defined your function to return an int, the function must always return an int. The 2 other return statements above are behind conditionals that could prevent their execution. So, without the last return statement, it is possible that the function wouldn't return an int, and so the compiler detects this and throws the "missing return statement" error.
Posts made by marktam264
RE: An accepted java solution and a minor question