Here you can find the source of listToStringArray(List
public static String[] listToStringArray(List<String> list)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { public static String[] listToStringArray(List<String> list) { if (null == list) { String[] stringArray = {}; return stringArray; }//from w w w . j a v a2 s .co m String[] stringArray = new String[list.size()]; list.toArray(stringArray); return stringArray; } }