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
(40)
Correct Answer:
Verified

C

Which of the following statements is false?

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

B

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

Free
(Multiple Choice)
4.7/5
(29)
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
(40)

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

(Multiple Choice)
4.9/5
(32)

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
(29)

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

(Multiple Choice)
4.8/5
(31)

By default, method sorted uses ________.

(Multiple Choice)
5.0/5
(31)

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

(Multiple Choice)
4.9/5
(29)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(30)

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
(40)

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

(Multiple Choice)
4.8/5
(40)

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
(37)

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

(Multiple Choice)
4.8/5
(40)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(27)

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

(Multiple Choice)
4.9/5
(30)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(35)

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

(Multiple Choice)
4.9/5
(35)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(36)

________ 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
(33)
Showing 1 - 20 of 67
close modal

Filters

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