What is the result of calling `stream().distinct()`?

  1. All elements are sorted
  2. All duplicate elements are removed
  3. The stream is reversed
  4. All null values are removed
Correct answer All duplicate elements are removed

Explanation

`distinct()` returns a stream with duplicate elements removed.

Update: Admin added a tag on this question

Topics

By Admin · · 31 views