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