Class Factorial

    • Constructor Summary

      Constructors 
      Constructor Description
      Factorial()  
    • Method Summary

      Modifier and Type Method Description
      static long value​(int n)
      Computes the factorial of n.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Factorial

        public Factorial()
    • Method Detail

      • value

        public static long value​(int n)
        Computes the factorial of n.
        Parameters:
        n - Argument.
        Returns:
        n!
        Throws:
        java.lang.IllegalArgumentException - if n < 0.
        java.lang.IllegalArgumentException - if n > 20 (the factorial value is too large to fit in a long).