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
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)
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.
Dis correct, until terminal operator is called the source won't generate streams.
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.1z0-819 Exam Questions
Log in to ExamTopics
Sign in:
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.
ASPushkin
7 months, 3 weeks agoASPushkin
3 months, 3 weeks agothanhbt
1 year, 2 months agod7bb0b2
1 year, 3 months agoStavok
1 year, 10 months agoMukes877
1 year, 10 months agoRP384
2 years, 2 months ago