Factorial.java 313B

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