What does `Collectors.toCollection(TreeSet::new)` do?
Correct answer
Returns a TreeSet containing sorted elements
Explanation
`Collectors.toCollection(TreeSet::new)` collects elements into a TreeSet (sorted set).
Update: Admin added a tag on this question
Topics
By Admin · · 33 views