Saturday, February 25, 2006

Vectors in Java

Since I have been working on integrating Lucene, my current posts will talk more about Java than anything else.

What are Vectors?
Vectors defined in java.util package.

import java.util.Vector;


Think of them as arrays that dynamically resize.
Vectors are slower than arrays.

Sample usage

vec = new Vector();
v.addElement(myArticle);
for(int i=0;i<index;i++)
{
myArticle=(Article)vec.elementAt(i);
}

0 Comments:

Post a Comment

<< Home

eXTReMe Tracker