Factorial.java 339B

123456789101112131415161718
  1. import java.math.BigInteger;
  2. public class Factorial {
  3. public BigInteger factorialOf(Integer value){
  4. BigInteger factorial = new BigInteger("1");
  5. for(int i = 1; i <= value; i++) {
  6. factorial = factorial.multiply(new BigInteger(Integer.toString(i)));
  7. }
  8. return factorial;
  9. }
  10. }