A

Admin • 831.35K Points
Coach

Q. What does `Collectors.toCollection(TreeSet::new)` do?

  • (A) Returns a HashSet
  • (B) Returns a TreeSet containing sorted elements
  • (C) Returns a List
  • (D) Returns a Map

Explanation by: Admin
`Collectors.toCollection(TreeSet::new)` collects elements into a TreeSet (sorted set).

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.