Which of the following queues orders elements in the order they were inserted?

  1. PriorityQueue
  2. DelayQueue
  3. LinkedList (as Queue)
  4. TreeMap
Correct answer LinkedList (as Queue)

Explanation

LinkedList, when used as a queue, maintains insertion order (FIFO).

Update: Admin added a tag on this question

Topics

By Admin · · 30 views