Factorial.java 344B

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