It is a simple process to convert an array to a list or vice-versa.
Convert an array to a list
In the example below I have used which is generics and is not a necessary part of the code but is good coding practice. the value between the is the object type ie String, Date, MyObject etc.
Arrays is a java.util.Arrays object.
ListstringList = Arrays.asList(stringArray);
Lists can also be created on the dynamically in the following way.
ListstringList = Arrays.asList(new String[]{"aString", "someText", astringVariable});
Convert a list into an array
List
String[] stringArray = stringList.toArray();
As above you can also supply an array to the toArray method of the list interface (although what benefit this provides is not clear in this example).
String[] stringArray = stringList.toArray(new String[]{});


