Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 16 Question 61 Discussion

Actual exam question for Oracle's 1Z0-809 exam
Question #: 61
Topic #: 16
[All 1Z0-809 Questions]

Given:

IntStream stream = IntStream.of (1,2,3);

IntFunction inFu= x -> y -> x*y;//line n1

IntStream newStream = stream.map(inFu.apply(10));//line n2

newStream.forEach(System.out::print);

Which modification enables the code fragment to compile?

Show Suggested Answer Hide Answer
Suggested Answer: D


Contribute your Thoughts:

Xuan
4 days ago
The correct answer is D. We need to use the applyAsInt() method since the IntFunction is expecting an Integer parameter, not a UnaryOperator or IntUnaryOperator.
upvoted 0 times
...
Remedios
20 days ago
I'm not sure, but I think the rationale for B is that IntUnaryOperator is the correct functional interface for the lambda expression used in the code.
upvoted 0 times
...
Nydia
23 days ago
I disagree, I believe the correct answer is A.
upvoted 0 times
...
Keith
28 days ago
I think the correct answer is B.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77