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 14 Question 85 Discussion

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

Given the code fragment:

UnaryOperator uo1 = s -> s*2;line n1

List loanValues = Arrays.asList(1000.0, 2000.0);

loanValues.stream()

.filter(lv -> lv >= 1500)

.map(lv -> uo1.apply(lv))

.forEach(s -> System.out.print(s + '' ''));

What is the result?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Lucina
1 months ago
I'm going with A. The stream will filter out the values less than 1500, then double the remaining values.
upvoted 0 times
Miss
13 days ago
C) A compilation error occurs at line n1.
upvoted 0 times
...
Lavera
14 days ago
I think it will be B) 4000
upvoted 0 times
...
Glenna
22 days ago
A) 4000.0
upvoted 0 times
...
...
Keva
2 months ago
I'm not sure, but I think there might be a compilation error at line n1
upvoted 0 times
...
Coleen
2 months ago
I agree with Celestina, the code should multiply by 2 and print the result
upvoted 0 times
...
Larue
2 months ago
Ha! I bet someone will say the answer is 'A compilation error occurs' just to be tricky.
upvoted 0 times
Gregg
4 days ago
User3
upvoted 0 times
...
Izetta
7 days ago
User2
upvoted 0 times
...
Zona
9 days ago
User1
upvoted 0 times
...
...
Chun
2 months ago
The key is understanding the UnaryOperator type. It's going to apply the lambda function to each element in the stream, doubling the value.
upvoted 0 times
...
Celestina
2 months ago
I think the result will be 4000.0
upvoted 0 times
...
Wai
2 months ago
Hmm, the question seems straightforward. I think the answer is A) 4000.0.
upvoted 0 times
Andra
1 months ago
I think so too, it should be A) 4000.0.
upvoted 0 times
...
Andra
1 months ago
I agree, the answer is A) 4000.0.
upvoted 0 times
...
Cammy
1 months ago
Great, we all agree on A) 4000.0 as the answer.
upvoted 0 times
...
Argelia
1 months ago
Yes, the correct answer is A) 4000.0.
upvoted 0 times
...
Huey
1 months ago
I think so too, it should be A) 4000.0.
upvoted 0 times
...
Irma
2 months ago
I agree, the answer is A) 4000.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