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 1 Question 32 Discussion

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

Given the code fragment:

List codes = Arrays.asList (10, 20);

UnaryOperator uo = s -> s +10.0;

codes.replaceAll(uo);

codes.forEach(c -> System.out.println(c));

What is the result?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Adaline
7 days ago
Haha, I'm going with C) A compilation error occurs. The code looks like it's written in some alien language, so it's bound to have issues compiling.
upvoted 0 times
...
Evangelina
8 days ago
I think the answer is B) 1020. The replaceAll method modifies the list in-place, so the original integer values are still present.
upvoted 0 times
...
Erick
21 days ago
The correct answer is A) 20.0 30.0. The UnaryOperator uo is applied to each element in the list, adding 10.0 to each value.
upvoted 0 times
Yoko
4 days ago
A) 20.0 30.0
upvoted 0 times
...
...
Malinda
24 days ago
I agree with Osvaldo, because the UnaryOperator cannot be applied to List.
upvoted 0 times
...
Osvaldo
25 days ago
I believe the answer is C) A compilation error occurs.
upvoted 0 times
...
Melvin
1 months ago
I think the result will be 20.0 and 30.0.
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