Exam 17: Lambdas and Streams

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

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

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

C

Which of the following statements is false?

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

B

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

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

C

Collectors static method ________ returns a Collector that counts the number of objects in a given classification, rather than collecting them into a List.

(Multiple Choice)
4.8/5
(79)

Terminal operations are ________; they perform the requested operation when they are called.

(Multiple Choice)
4.9/5
(66)

Stream method findFirst is a short-circuiting terminal operation that processes the stream pipeline and terminates processing as soon as the first object from the stream pipeline is found. The method returns a(n) ________ containing the object that was found, if any.

(Multiple Choice)
4.8/5
(79)

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

(Multiple Choice)
4.8/5
(74)

By default, method sorted uses ________.

(Multiple Choice)
5.0/5
(83)

Map method ________ performs an operation on each key-value pair.

(Multiple Choice)
5.0/5
(72)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(78)

Collectors static method groupingBy with two arguments receives a Function that classifies the objects in the stream and another Collector (known as the ________ Collector).

(Multiple Choice)
4.9/5
(87)

Prior to Java SE 8, Java supported three programming paradigms. Java SE 8 added ________.

(Multiple Choice)
4.8/5
(81)

Stream method ________ maps objects to double values and returns a DoubleStream. The method receives an object that implements the functional interface ToDoubleFunction (package java.util.function).

(Multiple Choice)
4.9/5
(80)

Class Array's ________ method is used to create a Stream from an array of objects.

(Multiple Choice)
4.9/5
(82)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(76)

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

(Multiple Choice)
4.9/5
(74)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(75)

The intermediate Stream operation ________ results in a stream containing only the unique elements.

(Multiple Choice)
5.0/5
(82)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(86)

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

(Multiple Choice)
4.8/5
(74)
Showing 1 - 20 of 67
close modal

Filters

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