Exam 17: Lambdas

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following statements is false?

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

B

Stream mutable reduction operation ________creates an array containing the results of the stream's prior operations.

Free
(Multiple Choice)
4.7/5
(45)
Correct Answer:
Verified

C

________ is a method reference for an instance method of a class. It creates a one-parameter lambda that invokes the instance method on the lambda's argument and returns the method's result.

Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
Verified

D

Functional interface Comparator's default method ________ reverses an existing Comparator's ordering.

(Multiple Choice)
4.7/5
(39)

Which of the following statements is true?

(Multiple Choice)
4.9/5
(38)

The basic generic functional interface ________ in package java.util.function contains method get that takes no arguments and produces a value of type T. Often used to create a collection object in which a stream operation's results are placed.

(Multiple Choice)
4.9/5
(41)

The basic generic functional interface ________ in package java.util.function contains method test that takes a T argument and returns a boolean. Tests whether the T argument satisfies a condition.

(Multiple Choice)
4.8/5
(36)

An ________ (package java.util.stream) is a specialized stream for manipulating int values.

(Multiple Choice)
4.9/5
(36)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(34)

Terminal Stream operation ________ performs processing on every element in a stream (e.g., display each element).

(Multiple Choice)
4.9/5
(45)

Intermediate operations are________; they aren't performed until a terminal operation is invoked. This allows library developers to optimize stream-processing performance.

(Multiple Choice)
4.8/5
(36)

________ is a constructor reference. It creates a lambda that invokes the no-argument constructor of the specified class to create and initialize a new object of that class.

(Multiple Choice)
4.9/5
(37)

Which statement in the following sequence of statements about sorting objects by two fields is false?

(Multiple Choice)
4.9/5
(45)

Functional interface BiConsumer's accept method has two parameters. For Maps, the first represents the ________ and the second the corresponding ________.

(Multiple Choice)
4.8/5
(42)

You can declare that an interface is a functional interface by preceding it with the @FunctionalInterface annotation. The compiler will then ensure that the interface contains ________; otherwise, it'll generate a compilation error.

(Multiple Choice)
4.7/5
(41)

A lambda expression represents a(n) ________ method-a shorthand notation for implementing a functional interface.

(Multiple Choice)
4.9/5
(40)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(39)

Map method entrySet returns a Set of Map.Entry objects containing the Map's ________.

(Multiple Choice)
4.8/5
(34)

The type of a lambda is the type of the ________ that the lambda implements.

(Multiple Choice)
4.7/5
(35)

What is the meaning of ( ) in the following lambda? () -> System.out.println("Welcome to lambdas!")

(Multiple Choice)
5.0/5
(37)
Showing 1 - 20 of 60
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)