Fundamentals

Default Methods

Collections

Idioms and Techniques

Design Rationale

Advanced Questions

Can lambda expressions use variables from their environment?

Yes. This is called variable capture. Instance and static variables may be used and changed without restriction in the body of a lambda. The use of local variables, however, is more restricted: capture of local variables is not allowed unless they are effectively final, a concept introduced in Java 8. Informally, a local variable is […]