exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 33 discussion

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

Given:

What is the output?

  • A. banana orange apple lemon
    -----
    apple banana lemon orange
    -----
  • B. -----
    banana orange apple lemon
    -----
    apple banana lemon orange
  • C. -----
    -----
  • D. -----
    -----
    banana orange apple lemon apple banana lemon orange
  • E. banana orange apple lemon apple banana lemon orange
    -----
    -----
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
ASPushkin
4 months, 2 weeks ago
Selected Answer: D
Stream<T> peek​(Consumer<? super T> action) This is an intermediate operation. Stream<T> sorted() statefull intermediate operation. sorted according to natural order. interface Comparable <R,​A> R collect​(Collector<? super T,​A,​R> collector) This is a terminal operation
upvoted 1 times
ASPushkin
2 weeks, 6 days ago
Because of laziness the stream pipeline will not be invoked until a terminal operation is executed.
upvoted 1 times
...
...
thanhbt
11 months, 4 weeks ago
Selected Answer: C
C is correct
upvoted 1 times
...
d7bb0b2
1 year ago
Selected Answer: D
D is correct because only ----- print first and when collect is called execeute peek 1 (list in order original , sort , and peek2 (list ordered by natural order)
upvoted 1 times
...
Stavok
1 year, 7 months ago
Selected Answer: D
D is correct Tested
upvoted 1 times
...
Mukes877
1 year, 7 months ago
Selected Answer: D
D is correct because Intermediate operations in a stream are lazy, meaning they are not evaluated until a terminal operation is invoked. The purpose of a terminal operation is to produce a result or perform a side effect.
upvoted 1 times
...
RP384
1 year, 11 months ago
Selected Answer: D
Dis correct, until terminal operator is called the source won't generate streams.
upvoted 2 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