Functional idioms in Java Flashcards

1
Q

What is a lambda? Give a concrete example.

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

True or false?: a lambda must return a value.

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

If you take away the special syntax, what is a lambda under the hood?

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

What is the stream API? What problem does it solve?

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

Which types have stream methods?

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

If I’m using a type that doesn’t have stream methods, how do I make stream methods available?

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

Name the major stream operations (not methods, just conceptual things you can do with streams).

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

What type is returned by a stream’s .filter(predicate)?

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

How do I grab one item instead of a Stream? Is there more than one way?

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

Are streams greedy or lazy? What does that even mean?

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

What is a terminal operation?

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