[concurrency-interest] Questions about ArrayDeque

Rémi Forax forax at univ-mlv.fr
Fri Jul 21 08:30:18 EDT 2006


I have take a look to java.util.ArrayDeque today, and i have some 
questions :

- Quoting the documentation :
  "This class is likely to be faster than {@link Stack} when used as a 
stack"
  I used to use an ArrayList to implement a stack and
  there is neither reference to ArrayList nor comparaison between
  ArrayList and ArrayDeque in the documentation
 
  Is ArrayList is faster than ArrayQueue when used as a stack ?

- I've found two methods (removeFirstOccurrence() and contains())
   with mostly the same code.
  Perhaps this code could be shared between them ?

Rémi Forax
  


 



More information about the Concurrency-interest mailing list