exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 153 discussion

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

Given the code fragment:

Which should be inserted into line n1 to print Average = 2.5?

  • A. IntStream str = Stream.of (1, 2, 3, 4);
  • B. IntStream str = IntStream.of (1, 2, 3, 4);
  • C. DoubleStream str = Stream.of (1.0, 2.0, 3.0, 4.0);
  • D. Stream str = Stream.of (1, 2, 3, 4);
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Chiraj
Highly Voted 3 years, 11 months ago
The answer is B.
upvoted 7 times
...
Abdullah_Rahahleah
Highly Voted 4 years, 1 month ago
answer is B-tested
upvoted 5 times
...
6c84cb9
Most Recent 4 months, 3 weeks ago
B. IntStream str = IntStream.of(1, 2, 3, 4);
upvoted 1 times
...
DarGrin
8 months ago
Selected Answer: C
Answer is C. Stream.of() gives Stream<Integer> or Stream<Double>, not IntStream or DoubleStream. So A and C are incorrect. And Stream hat no method average(). So D is incorrect too.
upvoted 1 times
...
asdfjhfgjuaDCV
10 months, 3 weeks ago
B is the answer
upvoted 1 times
...
steefaand
11 months, 4 weeks ago
Selected Answer: B
B is correct.
upvoted 1 times
...
iSnover
11 months, 4 weeks ago
Selected Answer: B
The answer is letter b, it cannot be C using the method in the second line "getAsDouble()".
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:
SY0-701
London, 1 minute ago