import java.util.*;
public class Recursion2 {
// Reverse A String...
public static void reverse(String str, int Index) {
if (Index == 0) {
System.out.print(str.charAt(Index));
return;
}
System.out.print(str.charAt(Index));
reverse(str, Index - 1);
}
public static void main(String[] args) {
String str = "subhamoy";
System.out.println("The Reverse String is : ");
reverse(str, str.length() - 1);
}
}

0 Comments