import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
public class ArraysExample
{
public static void main(String[] args)
{
String[] array = {"Happy", "New", "Year", "2006"};
List list = Arrays.asList(array);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
System.out.println((String) iterator.next());
}
}
}
The result of our code is:
Happy
New
Year
2006
ref: http://www.kodejava.org/examples/25.html
Tuesday, June 16, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment