Why calling this function recursively does not throw a NullPointerException
问题 My question comes from this thread. Consider this code: public class Test { static Function<Integer, Integer> fibLambda = null; public static void main (String[] args) { fibLambda = n -> n <= 2 ? 1 : fibLambda.apply(n - 1) + fibLambda.apply(n - 2); System.out.println(fibLambda.apply(6)); } } The output above is 8. What I don't get is that how fibLamdba is initialized? It seems that I totally miss how the method invocation is done because I though that this code would produce a NPE. Hope my