// Application using a recursively defined method public class Factorial { static final long MAX = 10; public static void main (String[] args) { for ( long i = 0; i <= MAX; i++) System.out.println(i + "! = " + factorial(i)); } static private long factorial(long number) { if (number <= 1) return 1; //base case else return number * factorial(number - 1); } }