/** * A little class illustrating recursion for computing factorial * The variable names are horrible, but they fit on the screen in powerpoint **/ public class Factorial { public static void main(String[] args) { int B = new Factorial().factorial(5); System.out.println(B); } public int factorial(int value) { if (value==1) { return 1; } else { int result = value * factorial(value-1); return result; } } }