Fundamentals

Default Methods

Collections

Idioms and Techniques

Design Rationale

Advanced Questions

Can lambda expressions be used to define recursive functions?

Yes, provided that the recursive call uses a name defined in the enclosing environment of the lambda. This means that recursive definitions can only be made in the context of variable assignment and, in fact—given the assignment-before-use rule for local variables—only of instance or static variable assignment. So, in the following example, factorial must be […]