Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Public class RecursiveReverser extends String
  2. {
  3. public RecursiveReverser(String input);
  4. public String reverse(String input)
  5. {
  6. if(input.length()!=1)
  7. {
  8. String a = input.substring(input.length()-1,input.length());
  9. String b = input.substring(0,input.length-1);
  10. return(a+ reverse(b));
  11. }
  12.  
  13.  
  14.  
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement