Here you can find the source of listToStringArray(List objs)
public static String[] listToStringArray(List objs)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String[] listToStringArray(List objs) { return collectionToStringArray(objs); }//from w w w .j a v a 2 s. com public static String[] collectionToStringArray(Collection objs) { if (objs == null) return null; String[] ret = new String[objs.size()]; int idx = 0; for (Object o : objs) { ret[idx] = o.toString(); idx++; } return ret; } }