File
Doc
Category
Size
Date
Package
Factorial2.java
API Doc
Example
634
Mon Sep 22 13:30:30 BST 1997
None
Factorial2
java.lang.Object
public class Factorial2 extends Object
This class shows a recursive method to compute factorials. This method calls itself repeatedly based on the formula: n! = n * (n-1)!
Fields Summary
Constructors Summary
Methods Summary
public static
long
factorial
(
long
x)
if (x == 1) return 1; else return x * factorial(x-1);
Java Code Source