Adding Object to a Vector

Cedric Berger cedric at berger.to
Tue May 11 03:59:25 PDT 2004


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

|


More information about the freebsd-java mailing list