🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Declaring an Array of Strings?

#8592
From: John McGrath TeamB
Date: Sat, 10 Mar 2001 09:52
36 lines
2367 bytes
On Fri, 9 Mar 2001 10:04:56 +0100, Hartmut wrote:

> I hear the first time about ArrayList. All literature seems to suggest
> Vector only.
> Interesting!
> 
> Can you tell one or some sentences about the difference between both,
> and if there's a general recommendation?
> ArrayList seems to have less methods, but the standard one should need.
> Is it more performant?

Vector was part of the original JDK 1.0 class library.  The Collections 
classes were made available as an add-on to JDK 1.1, and were added as 
a standard part of JDK 1.2.  ArrayList is one of the Collections 
classes.

An ArrayList is almost the same thing as a Vector, but as Torsten 
points out, it does not have built-in synchronization.  That is good if 
you do not need the synchronization, since it will perform better.  And 
if you do need the synchronization, you can easily add it.

When the designed Collections, they decided on using some shorter 
method names, which I think is a good thing.  Instead of addElement(), 
you have add(), etc.

Starting with JDK 1.2, Vector was changed to implement the Collections 
List interface, so it also has the new Collections method names.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.1513a1ef74005b8298a047@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!sunqbc.risq.qc.ca!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail
References: <3aa6df5f$1_2@dnews> <uu254bq17.fsf@sds.no> <3aa7a736_2@dnews> <3AA7C6C2.8F36FA7F@borland.com> <3aa7d567$1_2@dnews> <MPG.15120441e52e5bb798a036@forums.borland.com> <3aa89cb9_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,9324d780b1c839d2
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-10 02:00:03 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!sunqbc.risq.qc.ca!nntp1.njy.teleglobe.net!teleglobe.net!hub.org!hub.org!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Declaring an Array of Strings?
Date: Sat, 10 Mar 2001 04:52:26 -0500
Organization: Another Netscape Collabra Server User
Lines: 36
Message-ID: <MPG.1513a1ef74005b8298a047@forums.borland.com>
References: <3aa6df5f$1_2@dnews> <uu254bq17.fsf@sds.no> <3aa7a736_2@dnews> <3AA7C6C2.8F36FA7F@borland.com> <3aa7d567$1_2@dnews> <MPG.15120441e52e5bb798a036@forums.borland.com> <3aa89cb9_1@dnews>
NNTP-Posting-Host: dslcv1-60.fast.net
X-Newsreader: MicroPlanet Gravity v2.30