View RSS Feed

My Java Tips

  1. Vector Capacity

    by , 11-13-2011 at 11:48 AM (My Java Tips)
    In this post, I will talk about the performance issues related to vector capacity. I have noticed, that normally developers donít care about the performance issues and declare the vector as:

    Java Code:
    Vector vector = new Vector();


    Newly created vector has no element in it so its size is 0 but its capacity is 10 by default. So if you donít specify the capacity of the vector (and call the default constructor), its capacity will be 10. Capacity of the vector is the ...
    Tags: capacity, vector Add / Edit Tags
    Categories
    Performance