package com.reverse;
public class ReverseWords {
public static String reverseTheString(String input)
{
if(input.length()>1)
return input.substring(input.length()-1, input.length()) + reverseTheString(input.substring(0,input.length()-1));
else
{
return input.substring(0, 1);
}
}
public static void main(String args[])
{
System.out.println(reverseTheString("hello"));
}
}
public class ReverseWords {
public static String reverseTheString(String input)
{
if(input.length()>1)
return input.substring(input.length()-1, input.length()) + reverseTheString(input.substring(0,input.length()-1));
else
{
return input.substring(0, 1);
}
}
public static void main(String args[])
{
System.out.println(reverseTheString("hello"));
}
}