A

Admin • 828.43K Points
Coach

Q. What does `drainTo()` method do in BlockingQueue?

  • (A) Transfers elements to another collection
  • (B) Deletes all elements
  • (C) Returns first element only
  • (D) Blocks until empty
  • Correct Answer - Option(A)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Queue

Explanation by: Admin
`drainTo()` removes all available elements and transfers them to another collection.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.