Card 09/ 09
All 9 cards
RecapDifficulty: Advanced1 min
One Abstract Method, Several Spellings
Five things this topic established, and where each one was.
| The thing | Where |
|---|---|
| A lambda is an object implementing an interface, chosen by where it is passed | Passing Behaviour to a Method as an Argument |
| A functional interface has exactly one abstract method | What Makes an Interface Functional |
Function, Predicate, Consumer and Supplier cover almost everything | Four Shapes on Two Axes |
| A method reference replaces a lambda that only passes its parameters through | Method References |
| Captured locals must never be assigned to, because the lambda holds a copy | Why Your Lambda Cannot Change That Variable |
A lambda has no type of its own. Everything about it — the parameter types, the return type, what it is allowed to touch — comes from the parameter it was handed to, and reading that parameter is how you read the lambda.