choose the right answer :  1. Intermediate Stream operation ……………. Results in a stream in which each element of the original stream is mapped to a new value . The new stream has the same number of elements as the original stream. a. Mapping b. Map c. Mapper d. Mapped 2. Which of the following statements is FALSE about lambda expressions? a. (x,y) -> {return x * X + y ;} b. (x,y) -> {return X + y ;} c. () -> system.out.println("Functional programming is funny") d. (int x , int y) -> {return x + y ;} 3. What is the meaning of () in the following lambda()-> system.out.println("Welcome to lambdas!")

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

choose the right answer : 

1. Intermediate Stream operation ……………. Results in a stream in which each element of the original stream is mapped to a new value . The new stream has the same number of elements as the original stream.

a. Mapping

b. Map

c. Mapper

d. Mapped

2. Which of the following statements is FALSE about lambda expressions?

a. (x,y) -> {return x * X + y ;}

b. (x,y) -> {return X + y ;}

c. () -> system.out.println("Functional programming is funny")

d. (int x , int y) -> {return x + y ;}

3. What is the meaning of () in the following lambda()-> system.out.println("Welcome to lambdas!")

a. The lambdas parameters are inferred .

b. The lambdas has an empty parameter list.

c. the lambdas parameters are supplied by a method reference.

d. the given expression is not a valid lambda.

4. what is the output p=of this programming code ?

String[] abcArray = {"D","B","C","B","A","D","D","F","E"};

 SortedSet tree = new TreeSet (Arrays.as list(abcArray));

 For(String s: tree.headSet("C"))

 System.out.print(s+"");

a. DEF

b. ABC

c. AB

d. CDEF

5. What is the value of result after processing the following statement ?

Int result = IntStream.rangeclosed(1,10).filter(v->v%2!=0).reduce(0,(a,b)->a+b);

a. 25

b. 20

c. 30

d. 28

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random access
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education