nWhat does the method funny return, in terms of its argument?
This code does compile and run.
Recall that substr(a, b)creates a string from the original,
using indices from A to b-1 .
private static String
funny( String thing ) {
String result = thing;
int last =
thing.length() - 1;
if ( last > 0 ) {
result =
thing.charAt( last )
+ funny( thing.substring( 0, last ) );
}