Here you can find the source of toStringArray(List list)
Parameter | Description |
---|---|
list | List to cast to a String Array |
public static String[] toStringArray(List list)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { /**/*from w ww . j a v a 2 s .c o m*/ * cast all Elememts of a list to a String array, make simple cast of the object by toString method * @param list List to cast to a String Array * @return String array from List */ public static String[] toStringArray(List list) { int i = list.size(); String[] arr = new String[i]; for (i--; i >= 0; i--) { arr[i] = list.get(i).toString(); } return arr; } }