Which method is used to transform elements in a Stream?

  1. filter()
  2. map()
  3. forEach()
  4. collect()
Correct answer map()

Explanation

map() is used to transform each element in the stream.

Update: Admin added a tag on this question

Topics

By Admin · · 37 views