Question: 1) 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

1)

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.

a)

self

b)

preserve

c)

original

d)

identity

2) Stream method ________ eliminates duplicate objects in a stream.

a)different

b)unique

c)distinct

d)discrete

3) Which of the following statements is false?

a)An advantage of streams over collections is that streams have their own storage, so once a stream is processed, it can be reused, because it maintains a copy of the original data source.

b) Streams move elements through a sequence of processing steps-known as a stream pipeline-that begins with a data source, performs various intermediate operations on the data source's elements and ends with a terminal operation.

c)A stream pipeline is formed by chaining method calls.

d)Streams are objects that implement interface Stream (from the package java.util.stream) and enable you to perform functional programming tasks.

4.- What is the meaning of ( ) in the following lambda?

a)The given expression is not a valid lambda

b)The lambdas parameters are inferred

c)The lambdas parameters are supplied by a method reference

d) The lambda has an empty parameter list

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

a) no abstract methods

b) one or more abstract methods

c)

only one abstract method

d)all abstract methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!