
Recitation
Authored by Han Meng
Computers
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
It's a pure function.
True
False
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
It's a pure function.
True
False
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Is IntTransformer a functional interface?
True
False
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the main defining property of functional interfaces?
Functional Interfaces are more functional.
Functional Interfaces have the @FunctionalInterface annotation.
Functional Interfaces have a single abstract method.
Functional Interfaces can be implemented using a lambda function.
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following are valid lambda expressions in Java?
() -> {}
(x, y) -> x * y
(String s) -> { int length = s.length(); return length + 1; }
() -> return 0;
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
(Self-Quiz) What is the main reason for the compilation error in the line G<A, Integer> g = a::foo;?
The number of parameters does not match
Parameter types do not match
Return value types do not match
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
How many statements are correct?
a. Lambda expressions are not necessarily lazy.
b. Memoization makes sense when function is deterministic.
Only the second statement is correct.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?