exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 211 discussion

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

Given:



and



Which code fragment inserted on line 11 prints the average salary of all employees from the Bay Area?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
d7bb0b2
8 months, 1 week ago
C is correct: for obtain the same result by collector can use: double averageSalary = roster.stream() .collect(Collectors.averagingInt(Employee::getSalary)); but is int average
upvoted 1 times
ASPushkin
7 months ago
"for obtain the same result by collector can use: double averageSalary = roster.stream() .collect(Collectors.averagingInt(Employee::getSalary));" this is for all employees it has to be just for "Bay Area"
upvoted 2 times
...
...
ASPushkin
8 months, 2 weeks ago
answer : C The main operations in a Stream pipeline and the order in which they occur are : filter sorted map collect So, there are C and D after that. There is no such method as average() in Stream class. IntStream : OptionalDouble avarage()
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:
AZ-305
Calgary, 1 minute ago