Functional idioms in Java Flashcards
1
Q
What is a lambda? Give a concrete example.
A
2
Q
True or false?: a lambda must return a value.
A
3
Q
If you take away the special syntax, what is a lambda under the hood?
A
4
Q
What is the stream API? What problem does it solve?
A
5
Q
Which types have stream methods?
A
6
Q
If I’m using a type that doesn’t have stream methods, how do I make stream methods available?
A
7
Q
Name the major stream operations (not methods, just conceptual things you can do with streams).
A
8
Q
What type is returned by a stream’s .filter(predicate)?
A
9
Q
How do I grab one item instead of a Stream? Is there more than one way?
A
10
Q
Are streams greedy or lazy? What does that even mean?
A
11
Q
What is a terminal operation?
A