🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8349

Re: Vector and ArrayList

#8349
From: John McGrath TeamB
Date: Mon, 26 Mar 2001 00:56
23 lines
1593 bytes
On Sun, 25 Mar 2001 18:25:36 -0500, Frank Young wrote:

> Could anyone tell me that what's the difference between Vector
> and ArrayList? What are their advantage and disadvantage?

Vector is available in JDK 1.0, whereas ArrayList was added in JDK 1.2.  
So if you need to target older VMs, such as a browser VM, you will 
probably want to use Vector.

Vector is synchronized by default, whereas ArrayList is not.  Since 
this adds a significant amount of overhead, you would be better off 
with an ArrayList if you do not need automatic synchronization at the 
level of the List/Vector class.  In most cases, synchronizing at a 
higher level makes more sense.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.15285ddac49f4ac598a0aa@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!209.92.40.60
References: <3abe7e9f$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,cbe344e5d3cc7d49
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-25 17:00:06 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Vector and ArrayList
Date: Sun, 25 Mar 2001 19:56:47 -0500
Message-ID: <MPG.15285ddac49f4ac598a0aa@forums.borland.com>
References: <3abe7e9f$1_2@dnews>
X-Newsreader: MicroPlanet Gravity v2.30
NNTP-Posting-Host: 209.92.40.60
X-Trace: 25 Mar 2001 16:52:20 -0800, 209.92.40.60
Lines: 23
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!209.92.40.60