Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public class RecursiveReverser extends String
- {
- public RecursiveReverser(String input);
- public String reverse(String input)
- {
- if(input.length()!=1)
- {
- String a = input.substring(input.length()-1,input.length());
- String b = input.substring(0,input.length-1);
- return(a+ reverse(b));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement