谁能给我个简单的vector的事例程序。谢谢
如题
import java.util.Vector;
class MyVectorDemo
{
public static void main(String [] args)
{
int iArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
Vector vc = new Vector();
for(int i = 0; i<iArray.length; i++)
vc.add(iArray[i]);
for(int i = 0; i<vc.size(); i++)
System.out.print(vc.get(i) + " ");
}
}