R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collector is useful to collect into a `TreeSet`?

  • (A) toTreeSet()
  • (B) toSet(TreeSet::new)
  • (C) toCollection(TreeSet::new)
  • (D) groupingBy(TreeSet::new)
  • Correct Answer - Option(C)
  • Views: 7
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`toCollection(TreeSet::new)` lets you collect into a `TreeSet`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.