Question: 1) A lambda expression represents a(n) ________ method-a shorthand notation for implementing a functional interface. -anonymous -unnamed -functional -undesignated 2)Which of the following statements is

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

-anonymous

-unnamed

-functional

-undesignated

2)Which of the following statements is false?

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

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

-A stream pipeline is formed by chaining method calls.

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

3)What is the meaning of ( ) in the following lambda?

-The given expression is not a valid lambda

-The lambdas parameters are inferred

-The lambdas parameters are supplied by a method reference

-The lambda has an empty parameter list

4)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.

-

no abstract methods

-one or more abstract methods

-only one abstract method

-

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!