R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector would you use to create a mutable collection with custom supplier?

  • (A) toCollection()
  • (B) toSet()
  • (C) toMap()
  • (D) groupingBy()
  • Correct Answer - Option(A)
  • Views: 3
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`toCollection(Supplier)` allows you to specify the collection type (e.g. `LinkedList::new`).

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.