Write a program to reverse String using recursion in Java

Below program illustrates how to reverse a String in Java using recursion:

public class ReverseStringUsingRecursion {
	public static void main(String[] args) {
		String s = "abcd";
	private static String reverseUsingRecursion(String s) {
		if(s == null || s.length() <=1) {
			return s;
		return reverseUsingRecursion(s.substring(1)) + s.charAt(0);

Author: Mahesh

Technical Lead with 10 plus years of experience in developing web applications using Java/J2EE and web technologies. Strong in design and integration problem solving skills. Ability to learn, unlearn and relearn with strong written and verbal communications.