Factorial.java 329B

12345678910111213141516171819
  1. import java.math.BigInteger;
  2. public class Factorial {
  3. public BigInteger factorialOf(Integer value){
  4. BigInteger answer = BigInteger.valueOf(1);
  5. for (long i = 2 ; i<= value.longValue(); i++){
  6. answer = answer.multiply(BigInteger.valueOf(i));
  7. }
  8. return answer;
  9. }
  10. }