Fena Elizabeth
Fena Elizabeth

Reputation: 33

Elementary Queue in java

Which is the most elementary queue in java. I just need enqueue and dequeue operations. My application is not concurrent. I find lot of confusing queue names here.

Upvotes: 3

Views: 481

Answers (2)

Rex Kerr
Rex Kerr

Reputation: 167911

java.util.LinkedList is the simplest.

java.util.ArrayDeque is the fastest.

Though it doesn't apply to you, java.util.concurrent.ConcurrentLinkedQueue is the most bullet-proof in that you can have multiple threads all talking to it at the same time without worry.

Upvotes: 6

Alex Nikolaenkov
Alex Nikolaenkov

Reputation: 2545

LinkedList is the most basic.

Upvotes: 9

Related Questions