Ch6 Lambdas and Functional Interfaces Flashcards

1
Q

What is a lambda expression?

A

A lambda expression is a short block of code which takes in parameters and returns a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the rules for accessing a variable from a lambda body inside a method?

A
  • Instance variable: allowed
  • Static variable: allowed
  • Local variable: allowed if effectively final
  • Method parameter: allowed if effictively final
  • Lambda parameter: allowed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly