/**
 * output the reverse of the String entered at
 * the command line recursively
 * @author Suzanne Balik, 25 Feb 2002
 */
public class RecursiveReverse {

  private static void outputReverse(String s) {
  
    if (s.length() == 0)
      return;
      
    else {
      outputReverse(s.substring(1));
      System.out.print(s.charAt(0));
    }
  }
  
  public static void main(String[] args) {
  
    if (args.length == 1) {
    
      outputReverse(args[0]);
      System.out.println();
      
    }
      
    else 
    
      System.out.println
        ("usage: java RecursiveReverse string");
      
  }
}