This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Urgent => WhichOne is Faster! ArrayList or Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Urgent => WhichOne is Faster! ArrayList or Vector" Watch "Urgent => WhichOne is Faster! ArrayList or Vector" New topic

Urgent => WhichOne is Faster! ArrayList or Vector

Altaf Raja

Joined: Dec 05, 2001
Posts: 5
whichOne is faster!
Vector or ArrayList ???
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

faster at doing what?

and I'm moving this:
from Servlets -> Java In General - Beginner
[This message has been edited by Mike Curwen (edited December 11, 2001).]
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9055
Depends on whether you are using threads and need synchronization or not.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
There have been discussions about this in the "performance" section.
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
The simple answer: ArrayList
Why? Vector has been around longer and developed into a sort of be-all do-all class with synchronization and support for many different API. ArrayList is a straitforward implementation of a List with no whistles or bells.
I agree. Here's the link:
subject: Urgent => WhichOne is Faster! ArrayList or Vector