/**---------------------------------------------------------*
* @author Madarapu Naveen *
* http://madarapunaveen.blogspot.com *
* ---------------------------------------------------------*
*/
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", "2011"};
List list = Arrays.asList(array);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
System.out.println((String) iterator.next());
}
}
}
This blog is for one who learn about java and open source tools. as a java developer i am writing my experience in this blog.
Friday, March 4, 2011
How do I convert array to collection?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment