12345678910111213141516171819
  1. import java.util.*;
  2. import java.math.BigInteger;
  3. public class Factorial {
  4. public BigInteger factorialOf(Integer value){
  5. BigInteger factorial = BigInteger.ONE;
  6. int number = 1;
  7. for (int i = value; i > 0; i--) {
  8. factorial = factorial.multiply(BigInteger.valueOf(i));
  9. }
  10. return factorial;
  11. }
  12. }