Over a million developers have joined DZone.

Array To List An Vice Veras

·
Convert an array to a list.


List listOfDates = Arrays.asList(arrayOfDates);


On the fly list construction:


List listOfDates = Arrays.asList(new Date[]{date1, date2});


Convert a list into an array:


Date[] arrayOfDates = listOfDates.toArray(new Date[]{});
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}