It depends on what you want:
List<String> list = new ArrayList<String>();
Now, if you want to save the list in an array, you can do one of them:
Object[] arrOfObjects = new Object[]{list}; List<?>[] arrOfLists = new List<?>[]{list};
But if you want list items in an array, do one of the following:
Object[] arrayOfObjects = list.toArray(); String[] arrayOfStrings = list.toArray(new String[list.size()]);
Reference:
source share