private static String stringReverseRecursive(String str)
{
// saves the last letter of the word in the variable c
char c = str.charAt (str.length()-1);
// take the last letter saved in c and joins the sub string of everything without the first letter and runs it again.
return c + stringReverseRecursive((str.substring(0,str.length()-1)));
}
When I try to call the function then the compiler gives me an error saying that it goes out of range. I think there is something wrong with the lat line and the char c line.