Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 May 2004 12:58:56 +0200
From:      Cedric Berger <cedric@berger.to>
To:        Jan Grant <Jan.Grant@bristol.ac.uk>
Cc:        freebsd-java@freebsd.org
Subject:   Re: Adding Object to a Vector
Message-ID:  <40A0B1F0.3090206@berger.to>
In-Reply-To: <Pine.GSO.4.58.0405111130450.23544@mail.ilrt.bris.ac.uk>
References:  <Pine.LNX.4.44.0405110908080.16050-100000@matrix.gatewaynet.com> <Pine.GSO.4.58.0405111130450.23544@mail.ilrt.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Jan Grant wrote:

>On Tue, 11 May 2004, Achilleus Mantzios wrote:
>
>
>>O kyrios Jayprakash_Gonella egrapse stis May 11, 2004 :
>>
>>
>>>Hi,
>>>     May this is not the proper forum for my question.
>>>
>>>Can any body explain the internal representation (memory-wise) of a Vector
>>>in Java? How does a Vector class implement a growable array of objects?
>>>
By looking at that function:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html#Vector(int,%20int)

You can guess that the vector has a backing array of |initialCapacity,
and when that array is too small, a new array ||capacityIncrement bigger
is allocated.
Cedric

|



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40A0B1F0.3090206>