hello
This commit is contained in:
15
TestJavaCollection3.java
Normal file
15
TestJavaCollection3.java
Normal file
@@ -0,0 +1,15 @@
|
||||
//write a java code to demonstrate vector
|
||||
import java.util.*;
|
||||
public class TestJavaCollection3{
|
||||
public static void main(String args[]){
|
||||
Vector<String> v=new Vector<String>();
|
||||
v.add("Ayush");
|
||||
v.add("Amit");
|
||||
v.add("Ashish");
|
||||
v.add("Garima");
|
||||
Iterator<String>itr=v.iterator();
|
||||
while(itr.hasNext()){
|
||||
System.out.println(itr.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user