Fill in the blanks in each of the following statements: a. Stream are formed from stream sources,

Question:

Fill in the blanks in each of the following statements:

a. Stream                 are formed from stream sources, intermediate operations and termi- nal operations.

b.    The following code uses the technique of     iteration:

    int sum = 0;

    for (int counter = 0; counter < values.length; counter++) {
    sum += values[counter];
    }

c. Functional programming capabilities focus on                  —not modifying the data source being processed or any other program state.

d. An implementation of the functional interface                 takes a T argument and returns void, and performs a task with its T argument, such as outputting the object, invoking a method of the object, etc.

e. An implementation of the functional interface                 takes no arguments and pro- duces a value of type T—this is often used to create a collection object in which a stream operation’s results are placed.

f. Streams are objects that implement interface Stream and enable you to perform func- tional programming tasks on                                                            of elements.

g. The intermediate stream operation                 results in a stream containing only the el- ements that satisfy a condition.

h.                place the results of processing a stream pipeline into a collection such as a List, Set or Map.

i. Calls to filter and other intermediate streams are lazy—they aren’t evaluated until an eager                 operation is performed.

j. Pattern method                 uses a regular expression to tokenize a String and create a stream.

k. Functional interfaces must contain only one                 method, but may also contain

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Early Objects

ISBN: 9780134743356

11th Edition

Authors: Paul Deitel, Harvey Deitel

Question Posted: