File
Doc
Category
Size
Date
Package
Factorial2.java
API Doc
Example
650
Sat Jun 02 02:41:02 BST 2001
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