Question: Write a recursive method called reverseString() that takes in a string as a parameter and returns the string in reversed order. The main method is
Write a recursive method called reverseString() that takes in a string as a parameter and returns the string in reversed order. The main method is provided to read a string from the user and call the reverseString() method.Ex: If the input of the program is:Hellothe reverseString() method returns and the program outputs:Reverse of "Hello" is "olleH".Ex: If the input of the program is:Hello, world!the reverseString() method returns and the program outputs:Reverse of "Hello, world!" is "!dlrow ,olleH".Hint: Move the first character to the end of the returning string and pass the remaining sub-string to the next reverseString() method call.

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
