Which method collects stream elements into a List?

  1. Collectors.toMap()
  2. Collectors.joining()
  3. Collectors.toList()
  4. Collectors.toCollection()
Correct answer Collectors.toList()

Explanation

`Collectors.toList()` collects elements from a stream into a List.

By Ram Sharma · · 23 views