Here is the example code, I came across this in Java The Complete reference, 9th edition.
// A simple example of recursion.
class Factorial { // this is a recursive method
int fact(int n) {
int result;
if(n==1) return 1;
result = fact(n-1) * n; //This is my question, why not just (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)); //
} }