Class Factorial

java.lang.Object
com.zybooks.dsaj.recursion.Factorial

public class Factorial extends Object
Demonstration of recursive factorial function.
  • Constructor Details

    • Factorial

      public Factorial()
  • Method Details

    • factorial

      public static int factorial(int n) throws IllegalArgumentException
      Computes the factorial of the given (nonnegative) integer)
      Throws:
      IllegalArgumentException
    • main

      public static void main(String[] args)
      Simple test, assuming valid integer given as command-line argument