Lambda expressions Flashcards

1
Q

What does the test( ) method of Predicate return?

A

A boolean.

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

Do you need to specify parameter type for a lambda expression?

A

No.

But if you do, you must put them in parenthesis. 
Ex: foo(newArrayList( ), (List a1) -> a1.isEmpty();
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

T/F: A lambda expression for a functional interface is essentially an implementation of the abstract method in the interface written in a very concise manner.

A

True.

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

What pieces of the method signature can the compiler figure out on its own for a lambda expression?

A

The parameter types, return keyword and brackets.

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

What is the basic syntax for a lambda expression?

A

(parameter list) OR single_variable_without_type -> { regular lines of code } OR just_an_expression_without_a_semicolon

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