Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

List vs Queue  RSS feed

 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am going to develop a TCP server. In this case I have to do queuing. So currently I'm using List as my queue. But java providing queue object. I want to know what is the best object for do queuing process.

Thank you.
 
Stephan van Hulst
Saloon Keeper
Posts: 6969
109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java has a Queue interface. You can take a look for yourself which classes in the standard API implement it that fit your needs. For a simple Queue, I can recommend ArrayDeque. However, you may also want to take a look at classes that implement BlockingQueue or PriorityQueue, if you need their specific semantics.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!