Exam 17: Lambdas

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

The basic generic functional interface ________ in package java.util.function contains method apply that takes two T arguments, performs an operation on them (such as a calculation) and returns a value of type T.

(Multiple Choice)
4.8/5
(32)

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

Which of the following statements is false?

(Multiple Choice)
4.8/5
(31)

Intermediate Stream operation ________ results in a stream with the specified number of elements from the beginning of the original stream.

(Multiple Choice)
4.8/5
(33)

You can define your own reductions for an IntStream by calling its ________ method. The first argument is a value that helps you begin the reduction operation and the second argument is an object that implements the IntBinaryOperator functional interface.

(Multiple Choice)
4.8/5
(34)

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

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

(Multiple Choice)
4.9/5
(37)

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

By default, method sorted uses ________.

(Multiple Choice)
4.9/5
(39)

2.3 Q3:Terminal operations are eager; they perform the requested operation when they are called.

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.7/5
(40)

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)
5.0/5
(39)

A nice performance feature of lazy evaluation is the ability to perform________ evaluation, that is, to stop processing the stream pipeline as soon as the desired result is available.

(Multiple Choice)
4.9/5
(36)

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

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

________ 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.9/5
(27)

________ is an intermediate operation that transforms a stream's elements to new values and produces a stream containing the resulting (possibly different type) elements.

(Multiple Choice)
4.9/5
(37)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(29)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
5.0/5
(42)
Showing 21 - 40 of 60
close modal

Filters

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