What is returned by `Collectors.counting()`?

  1. int
  2. double
  3. long
  4. Optional
Correct answer long

Explanation

`Collectors.counting()` returns a `long` representing the number of elements in the stream.

By Ram Sharma · · 35 views