3 static int factorial_1 (int n)
6 return n * factorial_1(n-1);
10 static int factorial_2 (int n)
13 return n * factorial_3(n-1);
17 static int factorial_3 (int n)
20 return n * factorial_2(n-1);
24 public static void main(String args[])
26 if (factorial_1 (5) != 120)
27 System.out.println("This should not happen");
29 System.out.println("OK");
30 if (factorial_2 (5) != 120)
31 System.out.println("This should not happen");
33 System.out.println("OK");