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