Given the code fragment: List<Integer> list1 = Arrays.asList(10, 20); List<Integer> list2 = Arrays.asList(15, 30); //line n1 Which code fragment, when inserted at line n1, prints 10 20 15 30?
Not tested, but I think :
- B doesn't compile because List.intStream() doesn't exist
- C doesn't compile because Stream.flatMap() expects a function as parameter, while a Stream is provided
- D almost compiles but doesn't : flatMapToInt() exists, though a wrong parameter is provided.
Expected: Function<List<Integer>, IntStream>
Provided: Function<List<Integer>, Stream<Integer>>
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
thetech
Highly Voted 4 years, 8 months agoM_Jawad
Highly Voted 4 years, 6 months agoasdfjhfgjuaDCV
Most Recent 4 months, 3 weeks agosteefaand
5 months, 3 weeks agoGaelBernard
11 months, 3 weeks agoWilsonKKerll
2 years, 4 months agojduarte
3 years, 4 months agoayzo
3 years, 6 months agothetech
4 years, 8 months ago