MCPcopy Create free account
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

functional/RecursiveFactorial.java:8–12  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6public class RecursiveFactorial {
7 static IntCall fact;
8 public static void main(String[] args) {
9 fact = n -> n == 0 ? 1 : n * fact.call(n - 1);
10 for(int i = 0; i <= 10; i++)
11 System.out.println(fact.call(i));
12 }
13}
14/* Output:
151

Callers

nothing calls this directly

Calls 1

callMethod · 0.65

Tested by

no test coverage detected