Here you can find the source of listToStringArray(java.util.List list)
public static String[] listToStringArray(java.util.List list)
//package com.java2s; import java.util.ListIterator; public class Main { /** Get the values from specified list and return them as a string array. */ public static String[] listToStringArray(java.util.List list) { if (list == null) return null; String[] result = new String[list.size()]; ListIterator iterator = list.listIterator(); int i = 0; while (iterator.hasNext()) { result[i] = (String) iterator.next(); i++;/*from w w w . j a v a 2 s. c o m*/ } return result; } }