Java Exam CH. 17 Study Questions and Correct Answers
Prior to Java SE 8, Java supported three programming paradigms. Java SE 8 adds ________. a. procedural programming b. object-oriented programming c. generic programming d. functional programming. d. functional programming The new language and library capabilities that support functional programming were added to Java as part of Project ________. a. Utilitarian b. Upsilon c. Lambda d. Utility c. Lambda Which of the following statements is false? a. Prior to functional programming, you typically determined what you wanted to accomplish, then specified the precise steps to accomplish that task. b. Using a loop to iterate over a collection of elements is known as external iteration and requires accessing the elements sequentially. Such iteration also requires mutable variables. External iteration is easier to parallelize. c. Letting the library determine how to iterate over a collection of elements is known as internal iteration. d. Functional programming focuses on immutability—not modifying the data source being processed or any other program state b. Using a loop to iterate over a collection of elements is known as external iteration and requires accessing the elements sequentially. Such iteration also requires mutable variables. External iteration is easier to parallelize. Actually, internal iteration is easier to parallelize. Which of the following statements is false? a. Functional interfaces are also known as single abstract method (SAM) interfaces. b. Package ion contains six basic functional interfaces BinaryOperator, Consumer, Function, Predicate, Supplier and UnaryOperator. c. There are many specialized versions of the six basic functional interfaces for use with int, long and double primitive values. There are also generic customizations of Consumer, Function and Predicate for binary operations—that is, methods that take two arguments. d. All of these statements are true All of these statements are true The basic generic functional interface ________ in package ion contains method apply that takes two T arguments, performs an operation on them (such as a calculation) and returns a value of type T. a. Consumer<T> b. Function<T,R> c. Supplier<T> d. BinaryOperator<T> d. BinaryOperator<T>
Written for
- Institution
- Java SE
- Course
- Java SE
Document information
- Uploaded on
- June 13, 2024
- Number of pages
- 13
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
java exam ch 17 study questions and correct answe
-
prior to java se 8 java supported three programmi
-
the new language and library capabilities that sup
Also available in package deal