Factorial.java 362B

123456789101112131415161718
  1. import java.math.BigInteger;
  2. public class Factorial {
  3. public BigInteger factorialOf(int value){
  4. BigInteger input = BigInteger.valueOf(value);
  5. BigInteger total = BigInteger.valueOf(1);
  6. for (int i = 1; i <= input.intValue(); i++){
  7. total = total.multiply(BigInteger.valueOf(i));
  8. }
  9. return total;
  10. }
  11. }