package recursion1;

/*
 * Given n of 1 or more, return the factorial of n, which is 
 * n * (n-1) * (n-2) ... 1. Compute the result recursively (without loops).
 * 
 * factorial(1) -> 1
 * factorial(2) -> 2
 * factorial(3) -> 6
 */

public class Factorial {
	
	public static void main(String[] args) {
		Factorial test = new Factorial();
		System.out.println(test.factorial(1));
		System.out.println(test.factorial(2));
		System.out.println(test.factorial(3));
	}
	
	public int factorial(int n) {
		  if (n == 1) return 1;
		  
		  return n * factorial(n-1);
	}
}

@@ -175,16 +175,17 @@
 rial(1) 
+-
 -%3E 1%0A * 
@@ -197,16 +197,17 @@
 rial(2) 
+-
 -%3E 2%0A * 
@@ -219,16 +219,17 @@
 rial(3) 
+-
 -%3E 6%0A */

Update Factorial.java