Cyber Monday 2024! 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 9 Question 70 Discussion

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

Given the code fragment:

Which modification enables the code to print Price 5 New Price 4?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Cherelle
2 months ago
I'm going with option A. Replacing line n2 with .map (n -> System.out.println (''New Price'' + n --1)) and removing line n3 should do the trick.
upvoted 0 times
Tamera
1 months ago
I'm not sure, but I would go with option B.
upvoted 0 times
...
Silva
1 months ago
I disagree, I believe option D is the right choice.
upvoted 0 times
...
Merlyn
2 months ago
I think option A is the correct one.
upvoted 0 times
...
...
Steffanie
3 months ago
Haha, I bet the real answer is to just add a '+' to the 'New Price' string! Developers love their shortcuts.
upvoted 0 times
Devorah
2 months ago
Haha, I bet the real answer is to just add a '+' to the 'New Price' string! Developers love their shortcuts.
upvoted 0 times
...
Ayesha
2 months ago
Maybe it's B) Replace line n2 with .mapToInt (n -> n -- 1);
upvoted 0 times
...
Vince
2 months ago
No, I believe it's A) Replace line n2 with .map (n -> System.out.println ('New Price' + n --1)) and remove line n3
upvoted 0 times
...
Nichelle
2 months ago
I think the answer is D) Replace line n3 with .forEach (n -> System.out.println ('New Price' + n));
upvoted 0 times
...
...
Elouise
3 months ago
I see your point, Hubert. I think you're right. The answer is D.
upvoted 0 times
...
Hubert
3 months ago
But if you replace line n3 with .forEach (n -> System.out.println (''New Price'' + n)), it will print Price 5 New Price 4.
upvoted 0 times
...
Erick
3 months ago
Option D seems more straightforward to me. Replacing line n3 with .forEach (n -> System.out.println (''New Price'' + n)) will directly print the new price.
upvoted 0 times
...
Lorrie
3 months ago
I think option B is the correct answer. Replacing line n2 with .mapToInt (n -> n -- 1) will decrement each value by 1 and print the new price.
upvoted 0 times
Bernadine
3 months ago
Yes, I think so too. It makes sense to decrement each value by 1 to get the new price.
upvoted 0 times
...
Nakita
3 months ago
I agree with you, option B seems like the correct choice.
upvoted 0 times
...
...
Blondell
3 months ago
I disagree, I believe the answer is A.
upvoted 0 times
...
Hubert
4 months ago
I think the answer is D.
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