R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is returned by `Collectors.groupingBy(..., Collectors.counting())`?

  • (A) Map<K, Integer>
  • (B) Map<K, Long>
  • (C) Map<K, Optional<T>>
  • (D) Map<K, String>
  • Correct Answer - Option(B)
  • Views: 24
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`counting()` returns `Long`, so the result is `Map<K, Long>`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.