Q. Which of the following is not a valid collector in Java 8?

  • (A) toList()
  • (B) toSet()
  • (C) toMap()
  • (D) toQueue()
πŸ’¬ Discuss
βœ… 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.
Explanation by: Pushkar
Although queues are a common data structure, there is no built-in collector to create a queue from a stream in Java 8.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
354
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Pushkar
Publisher
πŸ“ˆ
88%
Success Rate