Java核心代码例程之:VectorDemo.java
2008-01-05 08:38:08 来源:WEB开发网核心提示:import java.util.*;/** * Demonstrates how to use a Vector (essentially a growable array). ***/public class VectorDemo{public static void main(String args[]) thr
import java.util.*;
/**
* Demonstrates how to use a Vector (essentially a growable array).
***/
public class VectorDemo
{
public static void main(String args[]) throws Exception
{
Vector v = new Vector();
v.addElement("Mary");
v.addElement("John");
v.addElement("David");
v.addElement("Pam");
v.addElement("Joe");
for (int i=0; i < v.size(); i++)
System.out.PRintln("Hello " + (String)v.elementAt(i));
}
}
赞助商链接