import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ArrayListIterator {
public static void main(String args[]) {
List<String> strings = new ArrayList<String>();
strings.add("First Name");
strings.add("Last Name");
strings.add("Age");
Iterator<String> iterator = strings.iterator();
while(iterator.hasNext()) {
System.out.println("Value : " +iterator.next());
}
}
}
Thursday, May 16, 2013
ArrayList using iterator
Tags
# Core Java
# Java Collection
About Unknown
Kumar Bhatia is a technical resource working with Accenture and owns this blog on Java.
Java Collection
Labels:
Core Java,
Java Collection
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment