Q. Which of the following is not a valid collector in Java 8?
β
Correct Answer: (D)
toQueue()
Explanation: Although queues are a common data structure, there is no built-in collector to create a queue from a stream in Java 8.