Which method is used to convert a stream of objects into a set in Java?
a) toArray()
b) toList()
c) toSet()
d) toMap()
Solution: c) toSet()
Explanation: The toSet() method is used to convert a stream of objects into a set in Java.