Vectors *are* synchronized. You will still have a problem if your code
looks like
if( vector.contains( someObject) )
vector.remove( anotherObject )
Any will need to synchronize on something else or on the instance
itself.
On Mon, 2003-06-02 at 15:05, sjones wrote:
> some implemenations of collections are faster than others.
>
> Vectors are thought to be the slowest.
>
> you can run a simple test to see guage the impact of using
> one -vs- the other in your application.
>
>
> "Michael Ruppin" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Without checking the archives for specific references,
> > I'm still sure I've read on multiple occasions, "Don't
> > use Vectors, use ArrayLists". I was under the
> > impression that this was because Vectors are not
> > synchronized. After refactoring, today, I read here
> > that ArrayLists are not synchronized:
> >
> > http://java.sun.com/j2se/1.4.1/docs/api/java/util/ArrayList.html
> >
> > Time to refactor again? I need to be using one of the
> > static Collections.synchronized* methods, right?
> > Beyond using Objects that are synchronized, what
> > difference does it make which implementation of
> > Collection I choose?
> >
> > m
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> > http://calendar.yahoo.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]