Oracle
1Z0-809 · Question #246
Given the code fragment: 5. IntConsumer consumer = e -> System.out.println(e); 6. Integer value = 90; 7. / insert code fragment here / 8. consumer.accept(result); Which code fragment, when inserted…
The correct answer is A. Function<Integer, IntUnaryOperator> funRef = i -> e -> i + e; IntUnaryOperator funRefApply = funRef.apply(value); int result = funRefApply.apply(10). You've hit your session limit · resets 5:20pm (America/New_York)
Question
Given the code fragment:
- IntConsumer consumer = e -> System.out.println(e);
- Integer value = 90;
- /* insert code fragment here */
- consumer.accept(result);
Options
- AFunction<Integer, IntUnaryOperator> funRef = i -> e -> i + e; IntUnaryOperator funRefApply = funRef.apply(value); int result = funRefApply.apply(10);
- BIntFunction<Integer> funRef = i -> i + 10; int result = funRef.apply(value);
- CToIntFunction<Integer> funRef = i -> i + 10; int result = funRef.applyAsInt(value);
- DToIntFunction<Integer> funRef = i -> i + 10; int result = funRef.apply(value);
How the community answered
(63 responses)- A83% (52)
- B10% (6)
- C3% (2)
- D5% (3)
Explanation
You've hit your session limit · resets 5:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.