Search Header Logo

Recitation

Authored by Han Meng

Computers

University

Used 3+ times

Recitation
AI

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

Media Image

It's a pure function.

True

False

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

It's a pure function.

True

False

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

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

Media Image

(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.

Both statements are incorrect.
Only the first statement is correct.
Both statements are correct.

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?