I know this isn't the answer you're looking for, but this example should give you a general idea of a recursion-based program.
http://www.java-samples.com/showtutoria ... rialid=151class Factorial {
int fact(int n) {
int result;
if ( n ==1) return 1;
result = fact (n-1) * n;
return result;
}
}
class Recursion {
public static void main (String args[]) {
Factorial f =new Factorial();
System.out.println(“Factorial of 3 is “ + f.fact(3));
System.out.println(“Factorial of 3 is “ + f.fact(4));
System.out.println(“Factorial of 3 is “ + f.fact(5));
}
}
In the "Factorial" class, "int fact" is an instance of an integer- you would use a character or a string and instead of calling the instance of the integer "fact", you would call a string "word" and iterate character by character. I don't know the details of your assignment, but this should give you an idea.
