Exam 17: Lambdas and Streams

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

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.7/5
(34)

Stream reduction operation ________ uses the elements of a collection to produce a single value using an associative accumulation function (e.g., a lambda that adds two elements).

(Multiple Choice)
4.7/5
(30)

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

(Multiple Choice)
4.7/5
(37)

Which of the following statements is false?

(Multiple Choice)
4.7/5
(34)

________ is s method reference for a static method of a class. It creates a one-parameter lambda in which the lambda's argument is passed to the specified a static method and the lambda returns the method's result.

(Multiple Choice)
4.8/5
(36)

________ is a method reference for an instance method that should be called on a specific object. It creates a one-parameter lambda that invokes the instance method on the specified object-passing the lambda's argument to the instance method-and returns the method's result.

(Multiple Choice)
4.7/5
(35)

Class Arrays provides ________ stream methods for creating IntStreams, LongStreams and DoubleStreams from int, long and double arrays or from ranges of elements in the arrays.

(Multiple Choice)
4.9/5
(37)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(36)

Stream mutable reduction operation ________ creates a new collection of elements containing the results of the stream's prior operations.

(Multiple Choice)
4.9/5
(34)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(40)

An________ (package java.util.stream) is a stream that manipulates int values.

(Multiple Choice)
4.8/5
(36)

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

(Multiple Choice)
4.8/5
(47)

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

Method reduce's first argument is formally called a(n) ________ value-a value that, when combined with any stream element using the IntBinaryOperator produces that element's original value.

(Multiple Choice)
4.8/5
(30)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(36)

Intermediate Stream operation ________ results in a stream in which each element of the original stream is mapped to a new value (possibly of a different type)-e.g., mapping numeric values to the squares of the numeric values. The new stream has the same number of elements as the original stream.

(Multiple Choice)
4.8/5
(43)

The basic generic functional interface ________ in package java.util.function contains method apply that takes a T argument and returns a value of type R. Calls a method on the T argument and returns that method's result.

(Multiple Choice)
4.7/5
(34)

The basic generic functional interface ________ in package java.util.function contains method accept that takes a T argument and returns void. Performs a task with its T argument, such as outputting the object, invoking a method of the object, etc.

(Multiple Choice)
4.8/5
(27)

Interface Stream (package java.util.stream) is a generic interface for performing stream operations on objects. The types of objects that are processed are determined by the Stream's ________.

(Multiple Choice)
4.7/5
(31)

IntStream method ________ performs the count, min, max, sum and average operations in one pass of an IntStream's elements and returns the results as an IntSummaryStatistics object (package java.util).

(Multiple Choice)
4.8/5
(45)
Showing 21 - 40 of 67
close modal

Filters

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