Skip to content
Advertisement

reverse a string using recursion with java

I am trying to write a recursion to reverse a String.This is my approach.

JavaScript

I dont get why when it reaches the base case, where my a is already empty but I am still able to print out the reversed string.

Advertisement

Answer

you are not implementing any recursion, you just replaced two halves of a string.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement