Factorial.java 427B

12345678910111213141516171819
  1. import java.math.BigInteger;
  2. public class Factorial {
  3. public BigInteger factorialOf(Integer value){
  4. BigInteger answer = new BigInteger("1");
  5. BigInteger big = BigInteger.valueOf(value.intValue());
  6. value = big.intValue();
  7. int x = big.intValue();
  8. for ( x = 1; x <= value; x++){
  9. answer = answer.multiply(BigInteger.valueOf(x));
  10. }
  11. return answer;
  12. }
  13. }