. For the following method, what would be displayed by the call: mystery6("abcdefgh")?
public void mystery6(String sWord){
int nL = sWord.length();
if(nL > 1)
{
String sTemp = sWord.substring(nL/2,nL);
mystery6(sTemp);
System.out.println(sTemp);
}
}
G. For the following method, what would be displayed by the call: mystery7("abcdefghijkl")?
public void mystery7(String sWord){
int nL = sWord.length();
if(nL >= 3)
{
mystery7(sWord.substring(0,nL/3));
System.out.println(sWord.substring(0, nL/3));
mystery7(sWord.substring(0,nL/3));
//substring(x) same as substring(x,length())
}
}
H. For the following method, what would be displayed by the call: mystery8("la-la-la")?
public void mystery8(String sWord){
int nL = sWord.length();
if(nL >= 3)
{
mystery8(sWord.substring(0,nL/3));
System.out.println(sWord.substring(nL/3,2*nL/3));
mystery8(sWord.substring(2*nL/3));
//substring(x) same as substring(x,length())
}
}