import java.math.BigInteger; public class Factorial { public BigInteger factorialOf(Integer value){ BigInteger answer = new BigInteger("1"); BigInteger big = BigInteger.valueOf(value.intValue()); value = big.intValue(); int x = big.intValue(); for ( x = 1; x <= value; x++){ answer = answer.multiply(BigInteger.valueOf(x)); } return answer; } }