hiexam
oracle · 1z0-809 · Q602 · multiple_choice · topic_1

Given: IntStream stream = IntStream.of (1,2,3); IntFunction<Integer> inFu= x -> y -> x*y; //line n1 IntStream newStream…

Given: IntStream stream = IntStream.of (1,2,3); IntFunction<Integer> inFu= x -> y -> x*y; //line n1 IntStream newStream = stream.map(inFu.apply(10)); //line n2 newStream.forEach(System.output::print); Which modification enables the code fragment to compile? line n1 with:
  • A.Replace IntFunction<UnaryOperator> inFu = x -> y -> x*y; line n1 with:
  • B.Replace IntFunction<IntUnaryOperator> inFu = x -> y -> x*y; line n1 with:
  • C.Replace BiFunction<IntUnaryOperator> inFu = x -> y -> x*y; line n2 with:
  • D.Replace
Explanation
B is correct: IntFunction<IntUnaryOperator> inFu = x -> y -> x*y;

Reference: examtopics_top_comment

Practice with progress tracking

Sign in to track wrong answers, get spaced-repetition reminders, and run timed exam mode.