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!")
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
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
Step by step
Solved in 2 steps