exam questions

Exam 1z0-816 All Questions

View all questions & answers for the 1z0-816 exam

Exam 1z0-816 topic 1 question 26 discussion

Actual exam question from Oracle's 1z0-816
Question #: 26
Topic #: 1
[All 1z0-816 Questions]

var numbers = List.of(0,1,2,3,4,5,6,7,8,9);
You want to calculate the average of numbers.
Which two codes will accomplish this? (Choose two.)

  • A. double avg = numbers.stream().parallel().averagingDouble(a −> a);
  • B. double avg = numbers.parallelStream().mapToInt (m −> m).average().getAsDouble();
  • C. double avg = numbers.stream().mapToInt (i −> i).average().parallel();
  • D. double avg = numbers.stream().average().getAsDouble();
  • E. double avg = numbers.stream().collect(Collectors.averagingDouble(n −> n));
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️
Community vote distribution
BE (100%)

Comments

Chosen Answer:
This is a voting comment. You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Sa16253748596
6 months, 1 week ago
Selected Answer: BE
B,E is true
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SC-300
Santiago, 1 minute ago