Solved

Consider the Method Below, Which Displays the Characters from a String

Question 13

Multiple Choice

Consider the method below, which displays the characters from a String in reverse order. Each character appears on a separate line. Select the statement that should be used to complete the method, so that it performs a recursive method call correctly. public static void printReverse(String word)
{
If (word.length() > 0)
{
___________________________
System.out.println(word.charAt(0) ) ;
}
}


A) printReverse(word) ;
B) printReverse(new String(word.charAt(1) ) ) ;
C) printReverse(word.substring(1) ) ;
D) printReverse(word.length() - 1) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions