import java.math.BigInteger; public class Factorial { public BigInteger factorialOf(Integer value){ BigInteger bi = BigInteger.valueOf(value); for (int i = 1; i < value; i++) { bi = bi.multiply(BigInteger.valueOf(i)); } return bi; } }