/**
 * Calculate the factorial of a non-negative integer 
 * 
 * @author Russell C. Bjork
 * @version March 24, 2008
 */
public class Factorial
{
    /** Calculate the factorial of a non-negative number
     *  @param n the number (must be non-negative)
     *  @return its factorial
     */
    public static int factorial(int n) {
    	if (n == 0)
    		return 1;
    	else
    		return n * factorial(n-1);
    }
}
