- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java program to reverse a string using recursion
Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function. You can reverse a string using the recursive function as shown in the following program.
Example
public class StringReverse { public String reverseString(String str){ if(str.isEmpty()){ return str; } else { return reverseString(str.substring(1))+str.charAt(0); } } public static void main(String[] args) { StringReverse obj = new StringReverse(); String result = obj.reverseString("Tutorialspoint"); System.out.println(result); } }
Output
tniopslairotuT
- Related Articles
- Python Program to Reverse a String Using Recursion
- Java Program to Reverse a Sentence Using Recursion
- Python Program to Reverse a String without using Recursion
- Java Program to Find Reverse of a Number Using Recursion
- Java Program to Reverse a String Using Stacks
- C++ program to Reverse a Sentence Using Recursion
- Python Program to Reverse a Stack using Recursion
- Haskell Program to Reverse a Sentence Using Recursion
- Golang Program to Reverse a Sentence using Recursion
- Write program to reverse a String without using reverse() method in Java?
- Java Program to Reverse a String
- C# Program to Reverse a String without using Reverse() Method
- Haskell Program to find the reverse of a given number using recursion
- Swift program to find the reverse of a given number using recursion
- Golang program to reverse a string using stacks

Advertisements