?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Multiple Method Call With Conditional Logic

APCSA-KLBEHV

Consider the following methods.

public static int stringA(String str)
{
    if (str.length()>5)
        return str.length()-2;
    else
        return str.length()+2;
}
public static String stringB(String str, int i)
{
    if (str.length()>i)
        return str.substring(i);
    return str + i;
}

What does the following statement from the same class print to the console?

System.out.println(stringB("helium",stringA("oxygen")));
A
u
B
helium
C
um
D
en
E
e