which of the following methods is recursive ?
public static int length(String str) {
if (str == null || str.equals(""))
return 0:
else
return 1 + length(str.substring(1));
}
public static int length(Strin str) {
return 1;
return 1 + len(str.substring(1));
java
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here