Vector class example

This commit is contained in:
mherbaghinyan 2018-12-06 15:23:13 +04:00
parent 8b8fda7d0b
commit a4d768763b
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
package com.baeldung.java.list;
import java.util.Enumeration;
import java.util.Vector;
public class VectorExample {
public static void main(String[] args) {
Vector<String> vector = new Vector<>();
vector.add("baeldung");
vector.add("Vector");
vector.add("example");
Enumeration e = vector.elements();
while(e.hasMoreElements()){
System.out.println(e.nextElement());
}
}
}